Anti weapon hack assistance
#1

So I basically made the stock for giving the weapons and I made a check.

Variable:
pawn Код:
new Weapons[MAX_PLAYERS][13], Ammo[MAX_PLAYERS][13];
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 weaps[13][2];
                for(new s = 0; s <= 12; s++)
                {
                    GetPlayerWeaponData(i, s, weaps[i][0], weaps[i][1]);
                    if(Weapons[i][s] != weaps[i][0] && )
                    {
                        format(strtd,sizeof(strtd), "(SERVER): %s(%d) possible weapon hacks (%s).", PlayerInfo[i][Name], i, WeaponName(weaps[i][0]));
                        SendAdminMessage(strtd, 0xD10000AA, 1);
                    }
                    if(Ammo[i][s] < weaps[i][1])
                    {
                        format(strtd,sizeof(strtd), "(SERVER): %s(%d) possible ammo hacks (%d) of weap. (%s).", PlayerInfo[i][Name], i, weaps[i][1], WeaponName(weaps[i][0]));
                        SendAdminMessage(strtd, 0xD10000AA, 1);
                    }
                    printf("sweapon %d, weapon %d, sammo %d, ammo %d", Weapons[i][0], weaps[i][0], Ammo[i][s], weaps[i][1]);
                }
            }
However it's giving some false information in the printf message, every time the variable Weapons is 0, the ammo variable works but the Weapons doesn't.

Example, I gave myself desert eagle and this is the result:
sweapon = variable weapon, sammo = variable ammo and ignore the slot part, didn't use it for this case.

Код:
[10:17:30] sweapon 0, weapon 24, sammo 250, ammo 300, sslot , slot 
[10:17:30] sweapon 0, weapon 0, sammo 200, ammo 0, sslot , slot 
[10:17:30] sweapon 0, weapon 0, sammo 0, ammo 0, sslot , slot 
[10:17:30] sweapon 0, weapon 0, sammo 400, ammo 0, sslot , slot 
[10:17:30] sweapon 0, weapon 0, sammo 0, ammo 0, sslot , slot 
[10:17:30] sweapon 0, weapon 0, sammo 0, ammo 0, sslot , slot 
[10:17:30] sweapon 0, weapon 0, sammo 4, ammo 0, sslot , slot 
[10:17:30] sweapon 0, weapon 0, sammo 0, ammo 0, sslot , slot 
[10:17:30] sweapon 0, weapon 0, sammo 0, ammo 0, sslot , slot 
[10:17:30] sweapon 0, weapon 0, sammo 0, ammo 0, sslot , slot 
[10:17:30] sweapon 0, weapon 0, sammo 0, ammo 0, sslot , slot
So what's wrong, how should I fix it?
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: 3 Guest(s)