local car_fly = false
function fly()
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_vehicles WHERE dm=?", 1)
local vehicle = getPedOccupiedVehicle(localPlayer)
if #result == 1 then
if car_fly == false then
setWorldSpecialPropertyEnabled("aircars", true)
outputChatBox("W??czy?e? tryb latania!",source)
car_fly = true
end
end
end
function offfly()
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_vehicles WHERE dm=?", 1)
local vehicle = getPedOccupiedVehicle(localPlayer)
if #result ~= 0 then
if car_fly == true then
setWorldSpecialPropertyEnabled("aircars", false)
outputChatBox("Wy??czy?e? tryb latania!",source)
car_fly = false
end
end
end
function removeHelmetOnExit (thePlayer, seat, jacked)
setWorldSpecialPropertyEnabled("aircars", false)
car_fly = false
end
addEventHandler ( "onClientVehicleExit", getRootElement(), removeHelmetOnExit )
addEventHandler("onClientResourceStart", getRootElement(), function()
bindKey("X", "down", fly) -- Tu masz bind
bindKey("C", "down", offfly)
end)