SA-MP Forums Archive
Giving vehicles their own 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: Giving vehicles their own ID. (/showthread.php?tid=246553)



Giving vehicles their own ID. - Ihsan-Cingisiz - 04.04.2011

Hello,

I really want to give vehicles their own unique ID. They must
keep the ID in any circumstances, like gamemode restart or
if I close and reopen the server again, they must keep the ID.

I want to make something like a dealership, that's why I want
this. Does someone have an idea or tip for how to make this?

Thanks.


Re: Giving vehicles their own ID. - Jakku - 04.04.2011

IF I understood what you meant, try something like this:

pawn Код:
new Car[10];

public OnGameModeInit()
{
//do NOT add any vehicles above
Car[0] = CreateVehicle(.....); //Vehicleid = 1, stays always same until you add other vehicles above these
Car[1] = CreateVehicle(.....); //Vehicleid = 2, stays always same until you add other vehicles above these
//And so on

}
I don't know was this what you're looking for, but at least I tried


Re: Giving vehicles their own ID. - Ihsan-Cingisiz - 04.04.2011

Quote:
Originally Posted by Jakku
Посмотреть сообщение
IF I understood what you meant, try something like this:

pawn Код:
new Car[10];

public OnGameModeInit()
{
//do NOT add any vehicles above
Car[0] = CreateVehicle(.....); //Vehicleid = 1, stays always same until you add other vehicles above these
Car[1] = CreateVehicle(.....); //Vehicleid = 2, stays always same until you add other vehicles above these
//And so on

}
I don't know was this what you're looking for, but at least I tried
Thanks for your reply, as I wanted to make a dealership, do you have a tip
for me how to use this to save it to a player, i'm using dini...

Thanks!