SA-MP Forums Archive
Vehicle ID's - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Vehicle ID's (/showthread.php?tid=362861)



Vehicle ID's - TheDeath - 25.07.2012

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?


Re: Vehicle ID's - [KHK]Khalid - 25.07.2012

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);