[center]Witam serdecznie
Mam taki problem, i? po zakupie pojazdu z salonu.
-- server
[lua]
function kupujemypojazd ( id, koszt )
local kasa = getPlayerMoney ( source )
local kosztpojazdu = koszt - 1
if kasa > kosztpojazdu then
local auto = createVehicle ( id, -1973.365234375, 248.23828125, 35.049915313721 )
local iiddd = math.random ( 1,100)
setElementData ( auto, "id", iiddd )
setElementData ( auto, "prywatne", true )
setElementData ( auto, "wlasciciel", getAccountName(getPlayerAccount(source)))
setElementData ( auto, "przebieg", 0 )
setElementData ( auto, "paliwo", 100 )
takePlayerMoney ( source, koszt )
warpPedIntoVehicle ( source, auto )
else
outputChatBox("Ten pojazd kosztuje "..koszt..".", source,255, 255, 255)
end
end
[/lua]
Nie mog? go namierzy?.
-- client
[lua]
function namierz (cmd,TO)
for k,v in ipairs ( getElementsByType ( "vehicle" ) ) do
if getElementData ( v, "id") == TO then
local x,y,z = getElementPosition ( v )
local blip = createBlip(x,y,z, 0, 2.5, 255, 0, 0 )
setTimer(destroyElement, 40000, 1, blip )
attachElements ( blip, v )
outputChatBox("Pojazd zosta? namierzony i zaznaczony blipem na mapie.", 255, 255, 255)
outputChatBox("Blip zniknie po 40 sekundach.", 255, 255, 255)
end
end
end