03.01.2013, 05:23
Quote:
Player 1 buys vehicle A.
Vehicle A is given SAMP ID 1. I save vehicle A and it is given MySQL ID 1. So far so good. Stats save and load fine. Player 2 spawns a temporary vehicle (Vehicle B) with a /veh command. Vehicle B is given SAMP ID 2. Because the vehicle is temporary and will disappear on a restart, no mysql ID is assigned. Player 3 buys vehicle C. Vehicle C is given SAMP ID 3. I save vehicle C, but it is only given MySQL ID 2. Now there's trouble. When trying to load vehicle C, the script loads the stats for MySQL ID 3 (which is non existent). |
Post all the code, and table structures associated with your system. Maybe it's just me, but your posts make you seem very confused on how to implement MySQL in your mode.
The SAMP vehicle ids shouldn't even be associated with loading/saving from your database. They're completely dynamic and shouldn't be used to index rows in a table. They should just be stored into temporary server memory in case you need to change the vehicle in any way via script.
According to your post, MySQL is doing exactly what it should be doing.