SA-MP Forums Archive
Not Checking? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Not Checking? (/showthread.php?tid=166228)



Not Checking? - ScottCFR - 07.08.2010

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;
}



Re: Not Checking? - DiddyBop - 07.08.2010

Is there a timer calling it?


Re: Not Checking? - ScottCFR - 07.08.2010

Yeah, every 3 seconds.

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



Re: Not Checking? - Vince - 07.08.2010

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].


Re: Not Checking? - ScottCFR - 07.08.2010

Okay, list of what weapons goto which slot?


Re: Not Checking? - Vince - 07.08.2010

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");
}



Re: Not Checking? - ScottCFR - 07.08.2010

Works perfect. Thanks