SA-MP Forums Archive
[FilterScript] Forbidden Weapon anti-cheat (no timers) - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Forbidden Weapon anti-cheat (no timers) (/showthread.php?tid=322484)



Forbidden Weapon anti-cheat (no timers) - Unknownich - 02.03.2012

Hi folks, this is my first FS on this forum so I hope you like it.

Last days I had a problem with my weapon anticheat with timer. I dont know why but timers sometimes fail to ban weapon hackers or if they ban, cheater can kill a lot of players before he got banned. So, I decided to script this simple script.

How it works?

Is simple, if cheater try to use any of these forbidden weapons he will be banned the first moment he press fire key.

pawn Код:
#include <a_samp>


public OnFilterScriptInit()
{
print("Forbidden Weapon FS Loaded");
}

public OnFilterScriptExit()
{
print("Forbidden Weapon FS Unloaded");
}


public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_FIRE && ForbiddenWeap(playerid) && !IsPlayerAdmin(playerid))
        {
            new pname[MAX_PLAYER_NAME];
            new string[124];
            GetPlayerName(playerid, pname, sizeof(pname));
            format(string, sizeof(string), "SERVER: %s has been banned! Reason: Forbidden weapon", pname);
            SendClientMessageToAll(0xffffffff,string);
            print(string);
            BanEx(playerid,string);
            return 1;
        }
    return 0;
}

stock ForbiddenWeap(playerid)
{
    new weap = GetPlayerWeapon(playerid);
    if( weap == 35 || weap == 36 || weap == 37 || weap == 38 || weap == 39 || weap == 40 || weap == 41 || weap == 42 || weap == 43 || weap == 44 || weap == 45)
    {
     return true;
    }
    return false;
}

//===========================Forbidden Weapons==================================
//id 35 = Rocket Launcher
//id 36 = HS Rocket Launcher
//id 37 = Flamethrower
//id 38 = Minigun
//id 39 = Satchel Charge
//id 40 = Detonator
//id 41 = Spraycan
//id 42 = Fire Extinguisher
//id 43 = Camera
//id 44 = Nightvision Goggles
//id 45 = Thermal Goggles



Re: Forbidden Weapon anti-cheat (no timers) - Eirikm - 02.03.2012

....


Re: Forbidden Weapon anti-cheat (no timers) - Unknownich - 02.03.2012

Quote:
Originally Posted by Eirikm
Посмотреть сообщение
Clean 'N' Easy

Cant see anything wrong here

God Work, Keep it up!
Thx


Re: Forbidden Weapon anti-cheat (no timers) - mickos - 28.04.2012

good work main!


AW: Forbidden Weapon anti-cheat (no timers) - 'Pawno. - 24.05.2012

Its really nice. Before this, i've made it with an timer. good work.


Re: Forbidden Weapon anti-cheat (no timers) - Rapgangsta - 24.05.2012

Sorry, but this isn't efficent, if an admin gives a Rocket to another user, he will get banned


Re: Forbidden Weapon anti-cheat (no timers) - Unknownich - 24.05.2012

Quote:
Originally Posted by Rapgangsta
Посмотреть сообщение
Sorry, but this isn't efficent, if an admin gives a Rocket to another user, he will get banned
Your brain isnt efficient my friend, probably lack of oxygen

If admin gives minigun to normal player and if is there anticheat he will be banned with this or any other anticheat.


Re: Forbidden Weapon anti-cheat (no timers) - Unknownich - 24.05.2012

Quote:
Originally Posted by ******
Посмотреть сообщение
No they won't! Not if the anti cheat is coded in ANY way well!
Ppl can do whatever they want with this script, make it worst or better. this is just an example how to ban cheater without checking all players. If they dont know how to edit some simple code and make it better thats their problem.


Re: Forbidden Weapon anti-cheat (no timers) - RobertPRO - 24.07.2012

How can I give weapons admins who givegun not take ban?


Re: Forbidden Weapon anti-cheat (no timers) - AcTopNN - 24.07.2012

I've seen a lot of kind of this "anti-cheat" but I still can't see the point, why you wasting your time for it, If someone will give to himself a shotgun or deagle? anyways great job, keep it up.


Re: Forbidden Weapon anti-cheat (no timers) - elad02658 - 29.04.2014

but
i need minigun
and i do
/giveweapon for admin
this is give ban ?


Re: Forbidden Weapon anti-cheat (no timers) - GeasyW - 29.04.2014

Quote:
Originally Posted by elad02658
Посмотреть сообщение
but
i need minigun
and i do
/giveweapon for admin
this is give ban ?
Dont you see the date? It's 2012 thread.. why are you bumping it? ..God.


Re: Forbidden Weapon anti-cheat (no timers) - d0nTtoucH - 13.07.2014

how to disable it banning admins ?