tiesjan Posted September 5, 2011 Share Posted September 5, 2011 how to make a script that if i typ the commands /fix that i repair my vehicle and how to bind key b to that..... Link to comment
dranton17 Posted September 5, 2011 Share Posted September 5, 2011 Here is the script . You just need to get the player's vehicle and then use the fixVehicle command . function fix (playerSource) local theVehicle = getPedOccupiedVehicle (playerSource) if theVehicle and getVehicleController ( theVehicle ) == playerSource then fixVehicle (theVehicle) outputChatBox ("Your vehicle has been fixed !" , thePlayer) end end addCommandHandler ("fix" , fix) Link to comment
tiesjan Posted September 5, 2011 Author Share Posted September 5, 2011 yes but how to bind the "fix" command and the "b" key. if i press "b" in the game that my vehicle get fixt Link to comment
NotAvailable Posted September 5, 2011 Share Posted September 5, 2011 function fix (playerSource) local theVehicle = getPedOccupiedVehicle (playerSource) if theVehicle and getVehicleController ( theVehicle ) == playerSource then fixVehicle (theVehicle) outputChatBox ("Your vehicle has been fixed !" , thePlayer) end end addCommandHandler ("fix" , fix) bindKey(source, "b", "Down", fix) Link to comment
CapY Posted September 5, 2011 Share Posted September 5, 2011 But you could just bind it .. like this /bind b fix 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