Posts: 53
Threads: 2
Joined: Jun 2007
Reputation:
0
You keep fopen the file as io_write, that means it'll start the output at the start of the file, meaning it'd erase any data already in that file, so this function would at best just store one cars position, the last saved one.
You should do io_write on first player it's saving and io_append on the rest, by the way you do no checks if the player is actually in a vehicle, if he's out of a vehicle, in vehicle 0, you still proceed by getting position of vehicle 0 and storing that, which makes no sense.
So two tips, validate that he's actually in a vehicle before you save, and only use io_write on the first player/vehicle to save, and io_append on the rest.
Posts: 101
Threads: 30
Joined: May 2009
Reputation:
0
I do not understand very well, but I have to say that file creates in scriptfiles folder. When I open it, there is only one line GetVehiclePos and nothing else. I really need this script, because when I restart my server, players says me that they have to buy cars again and spend it's money.