09.03.2014, 12:41
I've never worked with y_ini.
But re-reading you code, i found that you are saving by the wrong way.
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'
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.
}
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'