[FilterScript] Simple and Easy Anti-weapon hack script
#2

1) This is not ANTI WEAPON HACK, this just don't let you use these guns.

2) Using OnPlayerUpdate is bad, it gets called too often

3) Learn to use switch()

4) If you gonna script something like that, use OnPlayerKeyStateChange() - No timers/OnPlayerUpdate/lag.

pawn Code:
#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_FIRE))
    {
        switch(GetPlayerWeapon(playerid))
        {
            case 38, 42:
            {
                Ban(playerid);
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Simple and Easy Anti-weapon hack script - by Ped_Dep1 - 28.12.2012, 16:13
Re: Simple and Easy Anti-weapon hack script - by Djole1337 - 28.12.2012, 16:17
Re: Simple and Easy Anti-weapon hack script - by [WA]iRonan - 28.12.2012, 16:51
Re: Simple and Easy Anti-weapon hack script - by Djole1337 - 28.12.2012, 16:54
Re: Simple and Easy Anti-weapon hack script - by Ped_Dep1 - 29.12.2012, 06:43
Re: Simple and Easy Anti-weapon hack script - by Ped_Dep1 - 29.12.2012, 10:06
Re: Simple and Easy Anti-weapon hack script - by vMapper - 29.12.2012, 10:11
Re: Simple and Easy Anti-weapon hack script - by Ped_Dep1 - 29.12.2012, 10:48
Re: Simple and Easy Anti-weapon hack script - by Ped_Dep1 - 01.01.2013, 11:03
Re: Simple and Easy Anti-weapon hack script - by Mr.Faqahat - 11.01.2013, 12:48

Forum Jump:


Users browsing this thread: 1 Guest(s)