#1

I've made a perfect Car Ownership and everything works perfect till I restart the server.

The COS is based on IG Vehicle IDs so I can retrieve data from the file when a player who is not the owner enters it.
But there is one bug that i can't solve. I buy a car and drive it around, data stores in a file.Then I restart the server and then the cars don't load up in the way like they were created Ex: There are 5 cars on the server and I buy a sixth car and the car file is named "6". Then I restart the server and get into the car it has the data of the car 5 and so on.

The cars didn't create like they did before the restart.

Is there a way to change/impress this ?

Does anyone else have other ideas with the IDs ?

Please help, thanks.
Reply
#2

You have probably a StaticVehicle override from FS, meaning there is a AddStaticVehicle command somewhere in your gamemode that is causing the filterscript to overwrite it. Meaning like if you had a LSPD cruiser on slot 1 and then you buy a new car with the script that goes also on slot 1, your car will also be treated as an LSPD cruiser, even if its a tractor. I suggest you remove all staticvehicles from your gamemode, and try again.

Remember, a filterscript always overrides a gamemode.
Reply
#3

I understand what you are trying to say but this COS is scripted into the Gamemode and there are just 6 AddStaticVehicle cars in the GM and I check if a car is a COS car with if(OwnedVeh) which is
Код:
#define OwnedVeh GetPlayerVehicleID(playerid) >= 6
. Because I have kilometer measuring in my GM I need to save a COS car everytime a player exits a car with SaveVehicle(GetPlayerVehicleID(playerid)) and the ID changes on server restart...
Reply
#4

In that case i think its the problem with saving vars. What kind of database are you using? Could you provide me with that code of yours?
Reply
#5

I've figured it out.
My COS is loading files in the next order:
-Cars
-Motorcycles
-Bicycles
-Helis

If someone buyed a car and then a bicycle it wouldn't load it in the same order and mix the IDs.Going to fix this, thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)