Jump to content

[HELP]execute function when driving vehicle


Black2

Recommended Posts

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

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

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