SA-MP Forums Archive
Assign a vehicle to a player / account ? - 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: Assign a vehicle to a player / account ? (/showthread.php?tid=272327)



Assign a vehicle to a player / account ? - Gomma - 27.07.2011

Hey,

In my script I want to make it possible that every player can buy a vehicle etc. and that only this player can /lock, /sell and so on that vehicle. That means I want to assign it to a player. But to be honest, I have no clue how to do that. I thought about maybe generating a random number to identify players or so but I am not sure.

-> So how can I a) e.g. put a random number on vehicles ( not @ OnGameModeInit ) or b) Just assign a vehicle to a player?

Thanks.


Re: Assign a vehicle to a player / account ? - dowster - 28.07.2011

Vehicles[MAX_PLAYERS]
should be your array
then when the player logs in create the vehicle with
pawn Код:
Vehicles[playerid] = CreateVehicle(blah, blah, blah);