Jump to content

Problemas com bindKey + setVehicleEngineState


Recommended Posts

Oi gente. Eu estou tentando fazer um sistema de ligar/desligar o motor à base de bindKey. O código eu estou fazendo em server-side. Aí vai:

function engineOn(player, key, keyState, theVehicle) 
if(keyState == "down") then 
setVehicleEngineState(theVehicle, true) 
end 
end 
  
function engineOff(player, key, keyState, theVehicle) 
if(keyState == "down") then 
setVehicleEngineState(theVehicle, false) 
end 
end 
  
function bindTheKeys(player, commandName) 
bindKey(player, "j", "down", engineOn) 
bindKey(player, "k", "down", engineOff) 
end 
addCommandHandler("bindit", bindTheKeys) 

Quando eu digito /bindit, aparece na janela do servidor: "Bad argument @ setVehicleEngineState". Queria saber como resolver.

E outra pergunta: como eu faço pra essas keys já "bindarem" na hora que o player spawna?

Link to comment
  • 5 months later...

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...