OO b??d by? nie zauwa?y?em. Teraz powinno dzia?a?:
addEventHandler("onClientMarkerHit", l_marker, function(el)
if not el then return end
if not getPedOccupiedVehicle(el) then return end
if el ~= getLocalPlayer() then return end
local veh = getPedOccupiedVehicle ( el )
if veh then
if getElementData(veh,"sprzedaz") == true then
setElementData(veh,"pojazd_opis", "")
setElementData(veh,"sprzedaz", false)
end
end
end)
local x, y=guiGetScreenSize()
window = guiCreateWindow(220/800*x, 118/600*y, 339/800*x, 321, "Gie?da pojazd?w.", false)
guiWindowSetSizable(window, false)
label1 = guiCreateLabel(10/800*x, 43/600*y, 56/800*x, 24/600*y, "Cena:", false, window)
edit1 = guiCreateEdit(84/800*x, 42/600*y, 239/800*x, 31/600*y, "", false, window)
button = guiCreateButton(89/800*x, 140/600*y, 177/800*x, 39/600*y, "Zatwierdz", false, window)
button2 = guiCreateButton(89/800*x, 190/600*y, 177/800*x, 39/600*y, "Wyjdz", false, window)
label3 = guiCreateLabel(24/800*x, 217/600*y, 289/800*x, 86/600*y, "Po wpisaniu ceny i zatwierdzeniu\nodstaw auto na jakie? wolne miejsce.", false, window)
guiLabelSetHorizontalAlign(label3, "center", false)
guiLabelSetVerticalAlign(label3, "center")
guiSetVisible(window, false)
e_marker = createMarker(1640.18945+2, -1139.36218+2, 22.8, "cylinder", 7, 255, 0, 0, 130)
l_marker = createMarker(1637.15454+0.5, -1147.35291-3, 22.8, "corona", 10, 255, 0, 0, 130)
addEventHandler("onClientMarkerHit", e_marker, function(el)
local veh = getPedOccupiedVehicle ( el )
if (veh and getVehicleController(veh)==el) then
if getElementData(veh,"sprzedaz") == false then
if not el then return end
if not getPedOccupiedVehicle(el) then return end
if el ~= getLocalPlayer() then return end
guiSetVisible(window, true)
showCursor(true)
end
end
end)
addEventHandler("onClientMarkerHit", l_marker, function(el)
if not el then return end
if not getPedOccupiedVehicle(el) then return end
if el ~= getLocalPlayer() then return end
local veh = getPedOccupiedVehicle ( el )
if veh then
if getElementData(veh,"sprzedaz") == true then
setElementData(veh,"pojazd_opis","")
setElementData(veh,"sprzedaz", false)
end
end
end)
addEventHandler("onClientMarkerLeave", e_marker, function(el)
if not el then return end
if not getPedOccupiedVehicle(el) then return end
if el ~= getLocalPlayer() then return end
guiSetVisible(window, false)
showCursor(false)
end)
function setDescription(btn)
local veh = getPedOccupiedVehicle ( localPlayer )
local model = getElementModel(veh)
local nazwa=getVehicleNameFromModel(model)
local id = getElementData(veh,"car_id")
local przebieg2 = getElementData(veh,"pojazd_przebieg")
local przebieg= string.format("%.02f",(przebieg2))
local nick = getPlayerName(localPlayer)
if btn == "left" then
local cena = guiGetText(edit1)
if not tonumber(cena) then return end
if cena > "999999" then return end
if cena < "0" then return end
if veh then
setElementData(veh,"pojazd_opis", "Typ pojazdu:"..nazwa.."\n Numer pojazdu(id):"..id.."\n Przebieg pojazdu:"..przebieg.." \n Sprzedaj?cy:"..nick.."\n Cena:"..cena.."")
setElementData(veh,"sprzedaz", true)
guiSetVisible(window, false)
showCursor(false)
end
end
end
addEventHandler("onClientGUIClick", button, setDescription)
function setDescription2()
guiSetVisible(window, false)
showCursor(false)
end
addEventHandler("onClientGUIClick", button2, setDescription2)
U mnie normlanie dzia?a. Podmien tylko kordy marker?w.
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach