01.09.2015, 09:44
As easy as it sounds:
Код:
SavePlayerWeaponData(playerid) // save the data on disconnect { new weaponid, ammo, string[10] ; for (new i = 0; i != 13; i++) { GetPlayerWeaponData(playerid, i, weaponid, ammo); if(!weaponid) continue; format(string, sizeof (string), "Gun%02i", i); INI_WriteInt(File, string, weaponid); format(string, sizeof (string), "Ammo%02i", i) INI_WriteInt(File, string, ammo); } } // Load the data on first spawn new weaponid, ammo, string[10] ; for (new i = 0; i != 13; i++) { format(string, sizeof (string), "Gun%02i", i); INI_Int(string, weaponid); format(string, sizeof (string), "Ammo%02i", i) INI_Int(string, ammo); GivePlayerWeapon(playerid, weaponid, ammo); } }