Help with vehicle id
#1

Hi all
Can u help me please

I want to retrive the value of a vehicle create with CreateVehicle()

https://sampwiki.blast.hk/wiki/CreateVehicle

" Returns The ID of the vehicle created. "

How to get the value of this ID ?
Reply
#2

I'm not sure, but:
Код:
new string[128];
format(string,sizeof(string),"ID: %d", GetPlayerVehicleID(playerid));
return SendClientMessage(playerid, color, string);
Reply
#3

Try this:

Код:
    
new string[128];
format(string, sizeof(string), "ID: %i",vehicleid);
SendClientMessage(playerid, 0xFFFFFFFF, string);
Hope it helped.
Reply
#4

Thx ,
But i want to retrieve the vehicle id until enter to the vehicle ...
Reply
#5

pawn Код:
new vehicle; //This variable keeps the vehicle id, in this case it will be 1, because there is only one vehicle here :P

public OnGameModeInit()
{
    vehicle = CreateVehicle(/*your vehicle cords, etc in here*/);
}

//Use this to send the vehicle ID.
new string[24];
format(string, 24, "ID: %i", vehicle);
SendClientMessage(playerid, 0xFFFFFFFF, string);
Reply
#6

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[128];
format(string,sizeof(string),"ID: %d", GetPlayerVehicleID(playerid));
return SendClientMessage(playerid, color, string);
return 1;
}
Reply
#7

Thx The_Moddler
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)