Kurczak23
Wiek: 32 Na forum: 5032 dni Posty: 30
Piwa : 499
Kod: local test = createMarker(-1969.4, 480.79999, 35.17-1, "cylinder", 3, 255, 0, 0, 100)
local timer = 3 --Za ile sekund ma usunac pojazd po wjezdzie do markera
function usunpojazd(pojazd)
if not pojazd then return end
if not isElement(pojazd) then return end -- zabezpieczenie
if isElementWithinMarker(veh,test) then
local graczy = getVehicleOccupants(pojazd)
if #graczy > 0 then setTimer ( usunpojazd, timer*1000, 1, el) return end
destroyElement(veh)
return true
end
return false
end
addEventHandler("onMarkerHit",test,function(el,md)
if getElementType(el)=="vehicle" then
setTimer ( usunpojazd, timer*1000, 1, el)
end
end)
addEventHandler("onPlayerVehicleExit",getRootElement(),
function(veh)
if isElementWithinMarker(veh,test) then
destroyElement(veh)
end
end)