20.03.2012, 12:53
looks like a memory leak. one (not so simple, but working) solution:
when you delete (sell) a car (assuming slot [1], then copy the LAST vehicle parameter into that slot.
sell the [1cheetah], so it becomes clear first (your correct step so far):
now its time to fill the empty [1] with the last [2=supergt] to avoid the gap. after copying [2] to [1]...
...delete the [2]:
you need to script it for each player car entry, like mods, color etc yourself, but i hope the concept is clear 
advantage: when you buy a car, you may simply add it to the first unused entry. all cars gets rearranged (gap avoid) by copying the last entry to a deleted one.
DISadvantage: the cars' order may get messed up! (only their order, the system will still work)
when you delete (sell) a car (assuming slot [1], then copy the LAST vehicle parameter into that slot.
Код:
[0=landstalker] [1=cheetah] [2=supergt]
Код:
[0=landstalker] [1] [2=supergt]
Код:
[0=landstalker] [1=supergt] [2=supergt]
Код:
[0=landstalker] [1=supergt] [2]

Код:
PlayerCars[playerid][1]=PlayerCars[playerid][2]; PlayerCars[playerid][2]=0;
DISadvantage: the cars' order may get messed up! (only their order, the system will still work)

