08.02.2015, 18:14
Here are some tips on how to find the problem:
1. Add a debug message after each vehicle is loaded, for example:
printf("Vehs: %d | vModel: %d | vServerID: %d", TotalVeh, VehiclesInfo[TotalVeh][vModel], VehiclesInfo[TotalVeh][vServerID]);
This will tell you how many vehicles are created and if they are created as expected.
2. Looks like you're making a major mistake. vServerID is always changing, you can't keep it constant so don't store it in your database.
3. You're having this PlayerInfo[playerid][pCarKey] variable, but make sure that VehiclesInfo[ PlayerInfo[playerid][pCarKey] ] actually stores the info of that specific vehicle and not others.
1. Add a debug message after each vehicle is loaded, for example:
printf("Vehs: %d | vModel: %d | vServerID: %d", TotalVeh, VehiclesInfo[TotalVeh][vModel], VehiclesInfo[TotalVeh][vServerID]);
This will tell you how many vehicles are created and if they are created as expected.
2. Looks like you're making a major mistake. vServerID is always changing, you can't keep it constant so don't store it in your database.
3. You're having this PlayerInfo[playerid][pCarKey] variable, but make sure that VehiclesInfo[ PlayerInfo[playerid][pCarKey] ] actually stores the info of that specific vehicle and not others.