Saving weapons y_ini
#1

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

Код:
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);
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.
Reply


Messages In This Thread
Saving weapons y_ini - by Cepillado300 - 01.02.2014, 01:03
Respuesta: Saving weapons y_ini - by Cepillado300 - 02.02.2014, 07:30
Re: Saving weapons y_ini - by alex9419 - 02.02.2014, 07:49
Respuesta: Saving weapons y_ini - by Cepillado300 - 02.02.2014, 08:03

Forum Jump:


Users browsing this thread: 1 Guest(s)