15.03.2011, 16:08
Quote:
Ahh, you're complaining about after a restart - that's different. In that case why are you storing the ID in the first place? As you've seen IDs are meaningless over server restarts. Just store the data on the vehicle such as model, colour etc and recreate the vehicle every mode start, saving the returned ID in a global for that run only.
|
So this would be ok?
Command /buyvehicle
pawn Код:
/* PS: every vehicle has a file [1.ini;2.ini;3.ini...].*/
new veh;
for(new h = 1; h < sizeof(CarInfo); h++)//This will count the last vehicle created
{
if(CarInfo[h][cOwned] == 1)
{
veh = h + 1;
}
}
CarInfo[veh][vID] = veh;
PlayerInfo[playerid][pckey] = veh;