Black2 Posted August 27, 2016 Share Posted August 27, 2016 Hello, I was wondering how I can do to run the Test2 function when in a specific car, let's say infernus whose ID is 411, when driving with the vehicle perform this function, instead of with the command,would be grateful for your help, thank you If you have not understood very well,I made a script and it performs the function with the command, I want to convert it to work when you are inside the vehicle and driving,Thx again addCommandHandler( "Test", Test2 ) Link to comment
Bonus Posted August 27, 2016 Share Posted August 27, 2016 You could do it with onVehicleEnter, bindKey etc. Link to comment
Walid Posted August 27, 2016 Share Posted August 27, 2016 All what you need isPedInVehicle() -- To check if the player is currently in a vehicle. getPedOccupiedVehicle() -- Gets the vehicle that the player is currently in. getElementModel() -- Get the vehicle model ID getVehicleController() -- Get the controller (driver) of the vehicle Link to comment
idarrr Posted August 28, 2016 Share Posted August 28, 2016 If you want to call function when player enter the vehicle use OnVehicleEnter It will run function when player entering the vehicle. 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