UNIQUE id for vehicle. - 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: UNIQUE id for vehicle. (
/showthread.php?tid=224468)
UNIQUE id for vehicle. -
ajwar - 11.02.2011
Hi again, i use a new vehicle system(
https://sampforum.blast.hk/showthread.php?tid=222233 ) and i have a problem with that. When i make a car to be bought, it saves it to database perfectly. But if i wan't to make antoher vehicle it makes the same vehicleid. Here is the function which mades a 'unique id for a new spawned car':
pawn Код:
stock GetNewVehID()
{
for(new i = 1; i < MAX_BUYABLE_VEH; i++)
{
if(!vInfo[ivCreated[i]][vPrice]) return i;
}
return 255;
}
Does anyone can suggest something?
Re: UNIQUE id for vehicle. -
dice7 - 11.02.2011
I guess you already have 255 cars on your server ?
Re: UNIQUE id for vehicle. -
ajwar - 11.02.2011
I have just one car