11.03.2011, 09:05
You have the saving code already:
It's not too hard to make it load instead:
pawn Code:
new str[32];
foreach2(w, MAX_WEAPON_SLOTS)
{
GetPlayerWeaponData(playerid, w, PlayerInfo[playerid][Weapons][w], PlayerInfo[playerid][Ammo][w]);
format(str, sizeof (str), "Weapon_%d", w);
INI_WriteInt(Account, str, PlayerInfo[playerid][Weapons][w]);
format(str, sizeof (str), "Ammo_%d", w);
INI_WriteInt(Account, str, PlayerInfo[playerid][Ammo][w]);
}
pawn Code:
// put this inside the loading callback
new str[32];
foreach2(w, MAX_WEAPON_SLOTS)
{
format(str, sizeof (str), "Weapon_%d", w);
INI_Int(str, PlayerInfo[playerid][Weapons][w]);
format(str, sizeof (str), "Ammo_%d", w);
INI_Int(str, PlayerInfo[playerid][Ammo][w]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapons][w], PlayerInfo[playerid][Ammo][w]);
}