/Park - I need Help Its doesn't Save just crashes the Game
#5

pawn Код:
DestroyVehicle(vehicleid);
CreateVehicle(vehModel, vehX, vehY, vehZ, vehAng, vehCol1, vehCol2, 999999);
This is the problem, or at least a problem. Actually this will destroy/despawn the vehicle and then create a new one. But, here is the problem. Let's say you have 5 cars spawned on your server, and that this car is car number 2. Actully destroying the vehicle will deacrease the ID of every vehicles which had an ID >= 2:
Код:
ID 1 Car1
ID 2 Car2 
ID 3 Car3
ID 4 Car4
ID 5 Car5
So if you destroy Car2 which have ID 2:
Код:
ID 1 Car1
ID 2 Car3
ID 3 Car4
ID 4 Car5
ID 5 Unused
Then the CreateVehicle will do:
Код:
ID 1 Car1
ID 2 Car3
ID 3 Car4
ID 4 Car5
ID 5 Car2
So when you save car2 it will save car ID 5 which means that in your file the 5th cars will be updated, not the second.

PS: This will happen assuming the saving function (btw you don't need to make a public for it if I'm not wrong as it isn't using timer) saves the line matching with the car ID which is logic.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)