SA-MP Forums Archive
Help with vehicle id - 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: Help with vehicle id (/showthread.php?tid=188435)



Help with vehicle id - Krikkk - 07.11.2010

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 ?


Re: Help with vehicle id - blackwave - 07.11.2010

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



Re: Help with vehicle id - ExeC - 07.11.2010

Try this:

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


Re: Help with vehicle id - Krikkk - 07.11.2010

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


Re: Help with vehicle id - The_Moddler - 07.11.2010

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



Re: Help with vehicle id - blackwave - 07.11.2010

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



Re: Help with vehicle id - Krikkk - 07.11.2010

Thx The_Moddler