01.02.2014, 01:03
Hello, I have an issue on my script, when a player empties his ammo and then disconnects, the weapon ID is still written in his user file, but with 0 ammo, is there a way to save the weapon ID as 0 if the player doesn't have any ammo on that slot?
This is my code
Note: I am aware that this only saves the ammo and the ID of the pistol slot, what I need to know it's why it saves the last weapon in that slot after depleting its ammo, instead of saving it as a 0.
This is my code
Код:
new arma[13][2]; for (new i = 0; i < 13; i++) { GetPlayerWeaponData(playerid, i, arma[i][0], arma[i][1]); } GetPlayerWeaponData(playerid,2,arma[2][0],arma[2][1]); new pisdata[10]; format(pisdata,sizeof(pisdata),"%d,%d",arma[2][0],arma[2][1]); new INI:File= INI_Open(DirARU(playerid)); INI_SetTag(File,"Armas"); INI_WriteString(File,"Pistola",pisdata); INI_Close(File);