02.03.2012, 14:21
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.
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