Issues with a Weapon System
#5

I've never worked with y_ini.

But re-reading you code, i found that you are saving by the wrong way.

pawn Код:
stock SavePlayerWeapons(playerid)
{
    for(new x; x < 13; x++)
    {
        new weaponid = PlayerInv[playerid][iWeapons][x]; // Why you are setting a value, if you will change them at GetPlayerWeaponData?
        new ammo = PlayerInv[playerid][iWeaponammo][x];  // Why you are setting a value, if you will change them at GetPlayerWeaponData?
        GetPlayerWeaponData(playerid, x, weaponid, ammo); // You will set them finally here.
        new INI:File = INI_Open(UserPath(playerid));
        INI_WriteInt(File,"Weapons",PlayerInv[playerid][iWeapons][13]); // This will always write the same value, at all the iterations.
        INI_WriteInt(File,"Weapon_Ammo",PlayerInv[playerid][iWeaponammo][13]); // This will always write the same value, at all the iterations.
        INI_Close(File);
    }
    return 0; // Why return 0? This func WILL always return 0.
}
It will not save the weapons properlyl, i've explained the errors, try to fix them

If have 13 slots, you should save it into 26 "tags", 13 for the weapons ID's and the other 13 for the ammo.
You are just saving in only one o.o'
Reply


Messages In This Thread
Issues with a Weapon System - by Zonoya - 08.03.2014, 20:52
Re: Issues with a Weapon System - by arakuta - 08.03.2014, 21:51
Re: Issues with a Weapon System - by Zonoya - 09.03.2014, 05:37
Re: Issues with a Weapon System - by Zonoya - 09.03.2014, 11:21
Re: Issues with a Weapon System - by arakuta - 09.03.2014, 12:41
Re: Issues with a Weapon System - by Zonoya - 09.03.2014, 13:51

Forum Jump:


Users browsing this thread: 2 Guest(s)