zTokyoGamer Posted April 19, 2019 Share Posted April 19, 2019 [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
DNL291 Posted April 19, 2019 Share Posted April 19, 2019 Tente verificando: if theVehicle and ( getVehicleEngineState ( theVehicle ) == false ) then Se não funcionar, mostre como está sendo chamado o evento "motor-ON1". Link to comment
zTokyoGamer Posted April 19, 2019 Author Share Posted April 19, 2019 Estou esperando vê se a msg aparece novamente para teste amigo! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now