Not Checking?
#1

I made an Anti-Weapon hack. I don't know if it's not checking, or if it's not detecting the weapon.

pawn Код:
forward WeaponHack();
public WeaponHack()
{
    for(new p = 0; p < MAX_PLAYERS; p++)
    {
        if(IsPlayerConnected(p) == 1)
        {
            if(AccountInfo[p][AdminLevel] < 1)
            {
                new weapons[13][2];
                for (new i = 0; i < 13; i++)
                {
                    GetPlayerWeaponData(p, i, weapons[i][0], weapons[i][1]);
                    if(i == 35 || i == 36 || i == 37 || i == 38 || i == 44 || i == 45)
                    {
                        AntiCheatReport(p, "Weapon Hacks");
                    }
                   
                }
            }
        }
    }
    return 1;
}
Reply
#2

Is there a timer calling it?
Reply
#3

Yeah, every 3 seconds.

Код:
	SetTimer("WeaponHack", 3000, 1);
Reply
#4

The 'i' you are referring to in your if-statement is the weapon slot, not the weapon itself.
The weapon id is stored in the third variable, which is - in this case - weapons[i][0].
Reply
#5

Okay, list of what weapons goto which slot?
Reply
#6

I think this will work as-well. Replace with your if-statement.

pawn Код:
switch(weapons[i][0])
{
    case 35..38,44,45: AntiCheatReport(p, "Weapon Hacks");
}
Reply
#7

Works perfect. Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)