Getting id of vehicle
#1

Hello, I want to ask for help. How I can get the id of ownership vehicle.

This is cmd:
Код:
if(!strcmp(option, "park", true))
{
new vehicleid = GetPlayerVehicleID(playerid);
vehicleid returns me 111, but I need to get vInfo[something here][Id] which is 1, how I can get it? The vehicle is created like this:
Код:
vInfo[i][Vehicle] = CreateVehicle(vInfo[i][Model], vInfo[i][Pos][0], vInfo[i][Pos][1], vInfo[i][Pos][2]+0.5, vInfo[i][Pos][3], vInfo[i][Color][0], vInfo[i][Color][1], -1);
Reply
#2

Have you tried something like
pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
print("%d", vInfo[vehicleid][Id]);
Reply
#3

Yeah, it returns 0
Reply
#4

make a for loop

i.e:

pawn Код:
for(new i = 0; i < 100; i++)
{
    if(GetPlayerVehicleID(playerid) == vInfo[i][Vehicle])
    {
        // Here it is
    }
}
Reply
#5

Thanks, got it working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)