19.04.2017, 01:15
I really, really doubt the command itself is of any importance here. Earlier I've put some Client Messages in it, before and after the "suspicious" lines, and it seemed that nothing was executed after calling SaveTuningToFile. But anyway, here it is:
And here - https://pastebin.com/b3C8ksKS - is my data structure and the functions I use to temporarily save player's car components (until they save them with command), which doesn't seem to work either. I forgot to mention there, "LoadCar" gets called on player logging in. Underflow/overflow sounds possible, but what could be causing it?
Код:
CMD:savetuning(playerid,params[]) { new vehicleid=GetPlayerVehicleID(playerid); if(CooldownInfo[playerid][cSAVETUNING]>GetUnixTimePlus(0)) { new message[128]; format(message,sizeof(message),"You will be able to use this command in %ds.",CooldownInfo[playerid][cSAVETUNING]-GetUnixTimePlus(0)); SendClientMessage(playerid,COLOR_ERR_COOLDOWN,message); } else if(vehicleid==PrivCarInfo[playerid][carID]) { SaveTuningToFile(playerid); CooldownInfo[playerid][cSAVETUNING]=GetUnixTimePlus(10); SendClientMessage(playerid,COLOR_CMD_SUCCESS,"Tuning has been saved!"); } else { SendClientMessage(playerid,COLOR_ERR_USAGE,"You're not in your private vehicle."); } return 1; }