Vehicle ID's
#1

Hello guys i have a little question.
Example:
Creating some car:
CreateVehicle(599, -1612.2976, 733.7708, -5.1298, 0.0000, -1, -1, 100);
CreateVehicle(598, -1616.3976, 733.7708, -5.1298, 0.0000, -1, -1, 100);
Their id is 599 and 598
Making printf:
printf("Vehicle: %d" , GetPlayerVehicleID(playerid));
But when i try to get The Vehicle id with GetPlayerVehicleID(playerid);
If i enter the car with id 599 it says it is id 1 because its created first
so when i get id 598 it says id is 2
So my question is how to make to show the real vehicle id?
Reply
#2

599 and 598 are the MODEL id not the vehicle id. Here's an example on how to get a vehicle id:

pawn Код:
// Top of script
new Vehicle;
// Create a vehicle
Vehicle = CreateVehicle(599, -1612.2976, 733.7708, -5.1298, 0.0000, -1, -1, 100);
// CreateVehicle returns the created vehicle id so Vehicle now is equal to the created vehicle id
// To print the vehicle id
printf("Vehicle: %d", Vehicle);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)