Vehicle ID's
#1

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.
Reply
#2

All the vehicles will have a unique vehicle identification anyway, use that? And store it in a variable?
Reply
#3

Alright, ill try and figure it out, thanks for the help



(P.S My damn computer crashed lost all my damn work )
Reply
#4

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!
Reply
#5

How would i get a vehicle id, im still confused -.-
Reply
#6

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

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.

Reply
#8

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)