ODutii Posted August 4, 2019 Share Posted August 4, 2019 (edited) Qual o script para pressionar uma tecla e o motor ligar/desligar? help! function ligarveh() local theVehicle = getPedOccupiedVehicle(source) if ( getVehicleEngineState ( theVehicle ) == false ) then setVehicleEngineState ( theVehicle, true ) end if ( getVehicleEngineState ( theVehicle ) == true ) then setVehicleEngineState ( theVehicle, false ) end end addCommandHandler("motor on agora", ligarveh) bindKey("m", "down", "mottor on agora") CONSOLE: [11:39:08] WARNING: [G]S_PainelVeiculo\server.Lua:445: Bad argument @ 'bindKey' [Expected player at argument 1, got string 'm'] [11:39:08] [G]S_PainelVeiculo restarted successfully Edited August 4, 2019 by ODutii Link to comment
Blaack Posted August 4, 2019 Share Posted August 4, 2019 addEventHandler("onResourceStart", resourceRoot, function() for i, player in ipairs(getElementsByType("player")) do bindKey(player,"m", "down", "motoronagora") end end) function ligarveh(source) local theVehicle = getPedOccupiedVehicle(source) if ( getVehicleEngineState ( theVehicle ) == false ) then setVehicleEngineState ( theVehicle, true ) else setVehicleEngineState ( theVehicle, false ) end end addCommandHandler("motoronagora", ligarveh) Prontinho amigo ! (Testado) Você tinha esquecido algumas especificações e tirei algumas coisas desnecessárias... Aproveite seu script Deixa um thanks ae>>>>>>>>>> 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