12.04.2015, 08:46
I managed to have it working by changing some stuff.
Stock:
Check:
Looks fine now. Gonna test it more to see if I'm gonna find some bugs.
Stock:
pawn Код:
stock GivePlayerWeaponEx(playerid, weaponid, ammo)
{
Weapons[playerid][GetWeaponSlot(weaponid)] = weaponid;
Ammo[playerid][GetWeaponSlot(weaponid)] += ammo;
return GivePlayerWeapon(playerid, weaponid, ammo);
}
pawn Код:
if(GetPlayerWeapon(i) != 0 && GetPlayerAmmo(i) != 0)
{
new weapon = GetPlayerWeapon(i), ammo = GetPlayerAmmo(i);
if(Weapons[i][GetWeaponSlot(weapon)] != weapon || Ammo[i][GetWeaponSlot(weapon)] < ammo)
{
format(strtd,sizeof(strtd), "(SERVER): %s(%d) weap unbalance. Server-side: %s(%d), Client-side: %s(%d).", PlayerInfo[i][Name], i, WeaponName(Weapons[i][GetWeaponSlot(weapon)]), Ammo[i][GetWeaponSlot(weapon)], WeaponName(weapon), ammo);
SendAdminMessage(strtd, 0xD10000AA, 1);
}
printf("sweapon %d, weapon %d, sammo %d, ammo %d", Weapons[i][GetWeaponSlot(weapon)], weapon, Ammo[i][GetWeaponSlot(weapon)], ammo);
}