local b=createElement("text")
setElementData(b,"name","PRACA: Fotografie z lotu ptaka\nZAROBEK:\nGRACZ 18000PLN | PREMIUM 22000PLN\nOPIS: Wlatywanie w punkty wyznaczone przez system")
setElementPosition(b,1893.29749, -2328.56079, 14+0.5)
local zone = createColCuboid(1967.2745361328, -2380.1857910156, 12.546875, 11.75, 16.75, 7.5)
createBlip(1893.29749, -2328.56079, 13.54688, 46,2,0,0,0,0,0,275)
local m1 = createMarker(1893.29749, -2328.56079, 12, "cylinder", 2, 102, 255, 51)
vehs = {}
function removePreviousVehicles(plr)
for i,v in ipairs(getElementsByType("vehicle", resourceRoot)) do
local sby = getElementData(v, "zrespilGracz")
if sby and sby == plr and getPedOccupiedVehicle(plr) ~= v then
destroyElement(v)
end
end
end
addEventHandler("onMarkerHit", m1, function(el, md)
if getElementData(el, "zrespilGracz") then
outputChatBox("Praca w trakcie przygotowania.", el)
return
end
if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(el) then return end
if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("* Pas lotu zaj?ty! Poczekaj na zwolnienie miejsca!",el) return end
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_punish WHERE type=? AND active=? AND serial=? AND time>NOW()","prawko",1,getPlayerSerial(el))
if #result >= 1 then
outputChatBox("Posiadasz zawieszon? licencje: L",el)
return end
if getElementData(el,"player:license:pjL") == 0 then
outputChatBox("Nie posiadasz zdanej licencji kategori L", el, 255, 0, 0)
return
end
local x,y,z = getElementPosition(el)
local bus = createVehicle(593, 1971.92505,-2370.13916,15,360.1,1,180)
setElementData(bus,"vehicle:desc","Praca fotografa lotniczego!\n! Prosz? Zachowa? Ostro?no?? !")
setElementData(bus, "zrespilGracz", el)
setElementData(bus, "vehicle:fuel", 100000)
setElementData(bus, "vehicle:mileage", math.random(12978,109237))
setVehiclePlateText(bus, " PRACA" )
setVehicleColor(bus, 0, 96, 255 )
setVehicleHandling(bus,"maxVelocity", 100.00) -- 40 + 10 = 50km/h
warpPedIntoVehicle(el, bus)
removePreviousVehicles(el)
triggerClientEvent(el, "STARTJobBus", resourceRoot, bus)
setVehicleHandling(bus,"maxVelocity", 100.00) -- 40 + 10 = 50km/h
vehs[el] = bus
veh_obj[bus] = createObject(3031,0,0,0)
attachElements(veh_obj[bus],bus,0.3,-0.9,1.6,0,0,90)
end)
addEvent("STOPJobBus", true)
addEventHandler("STOPJobBus", resourceRoot, function()
local pojazd = getPedOccupiedVehicle(localPlayer)
if pojazd then
destroyElement(pojazd)
end
end)
addEvent("destroyVeh", true)
addEventHandler("destroyVeh", getRootElement(),
function()
if vehs[source] then
if isElement(vehs[source]) then destroyElement(vehs[source]) end
end
end)
addEventHandler("onPlayerVehicleExit",resourceRoot,function()
destroyElement(source)
end)
addEventHandler("onElementDestroy",resourceRoot,function()
if getElementType(source) == "vehicle" then
if veh_obj[source] then destroyElement(veh_obj[source]); veh_obj[source] = nil end
end
end)
addEvent("onPlayerQuit", true)
addEventHandler ( "onPlayerQuit", getRootElement(), function()
if vehs[source] then
if isElement(vehs[source]) then destroyElement(vehs[source]) end
end
end)
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