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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Vehicle ID's (
/showthread.php?tid=261123)
Vehicle ID's -
kin - 12.06.2011
Alright, i need help with a problem i am facing. It's about a simple vehicle system where it gives every vehicle bought a random number. This number will be used to tow the car back and to give keys to another player. So how would i do this? Just help me figure out the code to assign the number to the vehicle.
I have no idea where to start.
Re: Vehicle ID's -
Ash. - 12.06.2011
All the vehicles will have a unique vehicle identification anyway, use that? And store it in a variable?
Re: Vehicle ID's -
kin - 13.06.2011
Alright, ill try and figure it out, thanks for the help
(P.S My damn computer crashed lost all my damn work

)
Re: Vehicle ID's -
Benjo - 13.06.2011
Just posting here because I thought it's worth mentioning that SAMP assigns vehicleids starting at 1, unlike playerids which start at 0. It's something to note if you plan on keeping track of every single vehicle on there server!
Re: Vehicle ID's -
kin - 13.06.2011
How would i get a vehicle id, im still confused -.-
Re: Vehicle ID's -
Tee - 13.06.2011
pawn Код:
GetPlayerVehicleID(playerid);
Quote:
Originally Posted by Benjo
Just posting here because I thought it's worth mentioning that SAMP assigns vehicleids starting at 1, unlike playerids which start at 0. It's something to note if you plan on keeping track of every single vehicle on there server!
|
And I think we all should take note of this, I have seen where players make loops with vehicleids starting at 0.
Re: Vehicle ID's - Deskoft - 13.06.2011
Inside the game type /dl, there it shows the vehicleid.
Also using GetPlayerVehicleID(playerid); will retrieve the vehicle ID the player is inside.
Quote:
This forum requires that you wait 120 seconds between posts. Please try again in 25 seconds.
This forum requires that you wait 120 seconds between posts. Please try again in 5 seconds.
|
Re: Vehicle ID's -
Bmxerlmao5288 - 13.06.2011
Every Vehicle Has a Vehicle ID. First Vehicle in the map is Vehicle 1. Second Vehicle in the map is vehicle 2.
A Way to find it is
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[128];
format(string, sizeof(string), "You are entering vehicle %i",vehicleid);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}
This Says, The player Which is You, Is Enter The Vehicle Telling You That Your Entering Vehicle ID Number.
I Hope You Get It