Free next slot when a player buy a car
#1

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
Reply
#2

Associate the vehicle with the players and not the players with the vehicle?

So instead of a playervariable = vehicleid do vehiclevariable = playerid.
Reply
#3

more details please
Reply
#4

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.
Reply
#5

i have that
Reply
#6

If you already have that then there shouldn't be a problem.
Reply
#7

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.
Reply
#8

Why not create a file for every vehicle and associate the vehicles with their owners by storing the owner details inside the vehicle files?
Reply
#9

well this is what I locking
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)