I remade my weapon save sys and this is the problem.
Here's what you need to know:
Weapon1 - Melee
Weapon2 - Pistols
Weapon3 - Automatics
When relogging, it doesn't spawn Weapon2. If you have Weapon3, the ammo duplicates. Here's how weapon is saved. I have it under a timer for 1000ms.
I have GivePlayerRealWeapon on spawn.
Here's what you need to know:
Weapon1 - Melee
Weapon2 - Pistols
Weapon3 - Automatics
When relogging, it doesn't spawn Weapon2. If you have Weapon3, the ammo duplicates. Here's how weapon is saved. I have it under a timer for 1000ms.
PHP Code:
public WeaponSave()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new string[128], Name[MAX_PLAYER_NAME];
GetPlayerName(i, Name, sizeof(Name));
format(string, sizeof(string), "Accounts/%s.ini", Name);
GetPlayerWeaponData(i, 1, WeaponInfo[i][Weapon1], WeaponInfo[i][Weapon1a]);
GetPlayerWeaponData(i, 2, WeaponInfo[i][Weapon2], WeaponInfo[i][Weapon2a]);
if(WeaponInfo[i][Weapon3a] > 0)
{
switch(WeaponInfo[i][Weapon3a])
{
case 25:
{
GetPlayerWeaponData(i, 3, WeaponInfo[i][Weapon3], WeaponInfo[i][Weapon3a]);
}
case 28, 29, 32:
{
GetPlayerWeaponData(i, 4, WeaponInfo[i][Weapon3], WeaponInfo[i][Weapon3a]);
}
case 30, 31:
{
GetPlayerWeaponData(i, 5, WeaponInfo[i][Weapon3], WeaponInfo[i][Weapon3a]);
}
case 33, 34:
{
GetPlayerWeaponData(i, 6, WeaponInfo[i][Weapon3], WeaponInfo[i][Weapon3a]);
}
}
}
dini_IntSet(string, "Weapon1",WeaponInfo[i][Weapon1]);
dini_IntSet(string, "Weapon1a",WeaponInfo[i][Weapon1a]);
dini_IntSet(string, "Weapon2",WeaponInfo[i][Weapon2]);
dini_IntSet(string, "Weapon2a",WeaponInfo[i][Weapon2a]);
dini_IntSet(string, "Weapon3",WeaponInfo[i][Weapon3]);
dini_IntSet(string, "Weapon3a",WeaponInfo[i][Weapon3a]);
}
return 1;
}
PHP Code:
public GivePlayerRealWeapons(playerid)
{
new string[128], Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
format(string, sizeof(string), "Accounts/%s.ini", Name);
WeaponInfo[playerid][Weapon1] = dini_Int(string, "Weapon1");
WeaponInfo[playerid][Weapon1a] = dini_Int(string, "Weapon1a");
WeaponInfo[playerid][Weapon2] = dini_Int(string, "Weapon2");
WeaponInfo[playerid][Weapon2a] = dini_Int(string, "Weapon2a");
WeaponInfo[playerid][Weapon3] = dini_Int(string, "Weapon3");
WeaponInfo[playerid][Weapon3a] = dini_Int(string, "Weapon3a");
GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon1], WeaponInfo[playerid][Weapon1a]);
GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon2], WeaponInfo[playerid][Weapon2a]);
GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon3], WeaponInfo[playerid][Weapon3a]);
return 1;
}