Posts: 78
Threads: 0
Joined: May 2014
Posts: 1,079
Threads: 199
Joined: Jun 2013
Reputation:
0
Another thing you could do (although more technical) is create a loop to check if the player is in range of the car's coordinates.
Posts: 81
Threads: 19
Joined: Oct 2013
Reputation:
0
Yeah I got the GetPlayerVehicleID, but if I just created the car (Via a command) I want to know the vehicle ID after its created.
From SAMP Wiki: AddStaticVehicleEx
Return Values:
The vehicle ID of the vehicle created (between 1 and MAX_VEHICLES).
INVALID_VEHICLE_ID (65535) if vehicle was not created (vehicle limit reached or invalid vehicle model ID passed).
How would I get the returned value of the AddStaticVehicleEx?
If this is not possible I may have to go with Aerotactics suggestion.
Posts: 81
Threads: 19
Joined: Oct 2013
Reputation:
0
Ahh, thats what I needed.
Thanks for that!
Posts: 3,085
Threads: 37
Joined: Nov 2012
Reputation:
0
I think MAX_PLAYERS is more appropriate for this kind of command. That way, you can track who spawned the vehicle without introducing a new variable. For admin vehicles, normally you would delete the old admin vehicle before creating the new one, but just by changing it from MAX_VEHICLES to MAX_PLAYERS, that doesn't mean you can't spawn more than one, it just means the variable will change value, and it will save as the last vehicle id that you spawned. This won't limit the amount of vehicles you can create unless you code it to do otherwise.