Free next slot when a player buy a car - 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)
+--- Thread: Free next slot when a player buy a car (
/showthread.php?tid=433980)
Free next slot when a player buy a car -
Luca12 - 30.04.2013
So i wana ask how to make when a player buy a car to get a free slot in the file "cars" if you understand what I saying.
Example:
this is id 0
Car_0 and know a second player buy a car and that make a
Car_1
Re: Free next slot when a player buy a car -
Shoulen - 30.04.2013
Associate the vehicle with the players and not the players with the vehicle?
So instead of a playervariable = vehicleid do vehiclevariable = playerid.
Re: Free next slot when a player buy a car -
Luca12 - 30.04.2013
more details please
Re: Free next slot when a player buy a car -
Shoulen - 30.04.2013
Do you have existing code?
If so, instead of setting players to own vehicles set vehicles to be owned by players, that way each vehicle only needs one variable for the owner.
Re: Free next slot when a player buy a car -
Luca12 - 30.04.2013
i have that
Re: Free next slot when a player buy a car -
Shoulen - 30.04.2013
If you already have that then there shouldn't be a problem.
Re: Free next slot when a player buy a car -
Luca12 - 30.04.2013
but there is the problem wheN i and you buy car first it's create a file car_0 and inside is everything the owner and colors. Then is oke when you buy a car the file car_1 doesn't create when you buy a car my is just replaced with yours if you know what I mean.
Re: Free next slot when a player buy a car -
Shoulen - 30.04.2013
Why not create a file for every vehicle and associate the vehicles with their owners by storing the owner details inside the vehicle files?
Re: Free next slot when a player buy a car -
Luca12 - 30.04.2013
well this is what I locking