Jump to content

[Ajuda] SistemaMotor - WARNING


Recommended Posts

[2019-04-18 23:42:38] WARNING: [Script]SistemaMotor\[KND]_s.lua:21: Bad argument @ 'getVehicleEngineState' [Expected vehicle at argument 1, got boolean]
 --[[






 --]]

function OFF (theVehicle, leftSeat, jackerPlayer)
if leftSeat == 0 and not jackerPlayer then
local theVehicle = getPedOccupiedVehicle(source)
if ( getVehicleEngineState ( theVehicle ) == true ) then
setVehicleEngineState ( theVehicle, false )
triggerClientEvent (source, "motor-OFF", source)
end
end
end
addEventHandler ( "onPlayerVehicleEnter", getRootElement(), OFF )
--==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-
function ON ()
local theVehicle = getPedOccupiedVehicle(source)
if ( getVehicleEngineState ( theVehicle ) == false ) then
setVehicleEngineState ( theVehicle, true )
triggerClientEvent (source, "motor-ON", source)
end
end
addEvent("motor-ON1", true)
addEventHandler("motor-ON1", root, ON)
--==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-
function Systemcar ()
triggerClientEvent (source, "systemcar", source)
end
addEventHandler ( "onPlayerVehicleExit", getRootElement(), Systemcar )
--==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-
function Desligar ( theVehicle, leftSeat, jackerPlayer )
 if leftSeat == 0 and not jackerPlayer then
        setVehicleEngineState ( theVehicle, false )
    end
end
addEventHandler ( "onPlayerVehicleExit", getRootElement ( ), Desligar )

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...