Anti weapon hack assistance
#3

I managed to have it working by changing some stuff.

Stock:
pawn Код:
stock GivePlayerWeaponEx(playerid, weaponid, ammo)
{
    Weapons[playerid][GetWeaponSlot(weaponid)] = weaponid;
    Ammo[playerid][GetWeaponSlot(weaponid)] += ammo;
    return GivePlayerWeapon(playerid, weaponid, ammo);
}
Check:
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);
            }
Looks fine now. Gonna test it more to see if I'm gonna find some bugs.
Reply


Messages In This Thread
Anti weapon hack assistance - by LocMax - 12.04.2015, 08:18
Re: Anti weapon hack assistance - by R0 - 12.04.2015, 08:41
Re: Anti weapon hack assistance - by LocMax - 12.04.2015, 08:46
Re: Anti weapon hack assistance - by R0 - 12.04.2015, 08:48
Re: Anti weapon hack assistance - by LocMax - 12.04.2015, 08:50

Forum Jump:


Users browsing this thread: 1 Guest(s)