addEventHandler ( "onVehicleExplode", root, function()
local x = getElementData ( source, "x" )
local y = getElementData ( source, "y" )
local z = getElementData ( source, "z" )
local r1 = getElementData ( source, "r1" )
local r2 = getElementData ( source, "r2" )
local r3 = getElementData ( source, "r3" )
setTimer ( setElementHealth , 1000, 1, source, 100 )
setTimer ( fixVehicle , 1000, 1, source)
setTimer ( setElementPosition , 1000, 1, source, x, y, z )
setTimer ( setElementRotation , 1000, 1, source, r1, r2, r3 )
end)
function pozycja ( player )
local auto = getPedOccupiedVehicle ( player )
if auto then
local xa,ya,za = getElementPosition ( auto )
local xr,yr,zr = getElementRotation ( auto )
setElementData ( auto, "r1", tonumber(xr) )
setElementData ( auto, "r2", tonumber(yr) )
setElementData ( auto, "r3", tonumber(zr) )
setElementData ( auto, "x", tonumber(xa) )
setElementData ( auto, "y", tonumber(ya) )
setElementData ( auto, "z", tonumber(za) )
outputChatBox ( "Pojazd i miejsce pojazdu zapisane ! Po respawnie pojazd znajdzie si? w tym miejscu.", player, 255, 255, 255 )
else
outputChatBox ( "Wejd? do pojazdu !", player, 255, 255, 255 )
end
end
addCommandHandler ( "zaparkuj", pozycja )