SendClientMessageToAll(COLOR_RED," [ %s ] HAS BEEN BANNED BY THIS SERVERS SECURITY SYSTEM! [ REASON ] ( MINIGUN ) );
add the code into to check what world they are in. |
Hello again,
I am looking for an anti-weapon hack but in my server i have dms. I create new world for all dms but the main world (0) i want to create a script that will detect and clear weapons and return to player "Weapon hack detected - Weapons removed" and send message to admins "%s try to weapon hack". Also if is possible in the Dm world (1) i give specific weapons, so detect other weapons and remove them. |
new weaponchecktimer;// creating a variable
for(new i; i<MAX_PLAYERS; i++)
{
weaponchecktimer = SetTimerEx("Weaponchecktimer", 1000, 1,"i",i); //weapon check timer
}
forward Weaponcheck();
public Weaponcheck()
{
for(new i; i<MAX_PLAYERS; i++)
{
new playerid;
new illegalwep = 38;
new illegalwep1 = 38;
new illegalwep2 = 38; // list of weapon ids which are to be prohibited
new illegalwep3 = 38;
new illegalwep4 = 38;
new illegalwep5 = 38;
new weapon = GetPlayerWeapon(i);
GetPlayerWeapon(i);
if(weapon == illegalwep||weapon == illegalwep1||weapon == illegalwep2||weapon == illegalwep3||weapon == illegalwep4||weapon == illegalwep5)
{
SendClientMessage(i, COLOR_RED, "Anti cheat caught you with minigun ! You got Disarmed !");
ResetPlayerWeapons(playerid);
return 1;
}
return 1;
}
return 1;
}
forward Weaponchecktimer(playerid);
public Weaponchecktimer(playerid)
{
Weaponcheck();
return 1;
}
#define FILTERSCRIPT
#include <a_samp>
#pragma tabsize 0
new brass[MAX_PLAYERS]; //1
new golf[MAX_PLAYERS];//2
new nightstick[MAX_PLAYERS];//3
new knife[MAX_PLAYERS];//4
new baseball[MAX_PLAYERS];//5
new shovel[MAX_PLAYERS];//6
new pool[MAX_PLAYERS];//7
new katana[MAX_PLAYERS];//8
new chainsaw[MAX_PLAYERS];//9
new ddildo[MAX_PLAYERS];//10
new dildo[MAX_PLAYERS];//11
new vibrator[MAX_PLAYERS];//12
new svibrator[MAX_PLAYERS];//13
new flowers[MAX_PLAYERS];//14
new cane[MAX_PLAYERS];//15
new grenade[MAX_PLAYERS];//16
new tear[MAX_PLAYERS];//17
new molotov[MAX_PLAYERS];//18
new ninemm[MAX_PLAYERS];//22
new sninemm[MAX_PLAYERS];//23
new desert[MAX_PLAYERS];//24
new shotgun[MAX_PLAYERS];//25
new sshotgun[MAX_PLAYERS];//26
new cshotgun[MAX_PLAYERS];//27
new uzi[MAX_PLAYERS];//28
new mp5[MAX_PLAYERS];//29
new ak47[MAX_PLAYERS];//30
new m4[MAX_PLAYERS];//31
new tec[MAX_PLAYERS];//32
new crifle[MAX_PLAYERS];//33
new srifle[MAX_PLAYERS];//34
new rpg[MAX_PLAYERS];//35
new rocket[MAX_PLAYERS];//36
new flame[MAX_PLAYERS];//37
new minigun[MAX_PLAYERS];//38
new charge[MAX_PLAYERS];//39
new detonator[MAX_PLAYERS];//40
new spray[MAX_PLAYERS];//41
new fire[MAX_PLAYERS];//42
new camera[MAX_PLAYERS];//43
new nvission[MAX_PLAYERS];//44
new tvission[MAX_PLAYERS];//45
forward WeaponCheck( );
forward MessageToAdmins(color,const string[]);
#include <a_samp>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Anti Weapon hack - LOADED");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
print("\n--------------------------------------");
print(" Anti Weapon hack - UNLOADED");
print("--------------------------------------\n");
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public WeaponCheck()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(GetPlayerWeapon(i) == 1 && brass[i] == 0||GetPlayerWeapon(i) == 2 && golf[i] == 0||GetPlayerWeapon(i) == 3 && nightstick[i] == 0||GetPlayerWeapon(i) == 4 && knife[i] == 0||GetPlayerWeapon(i) == 5 && baseball[i] == 0||GetPlayerWeapon(i) == 6 && shovel[i] == 0||GetPlayerWeapon(i) == 7 && pool[i] == 0||GetPlayerWeapon(i) == 8 && katana[i] == 0||GetPlayerWeapon(i) == 9 && chainsaw[i] == 0||GetPlayerWeapon(i) == 10 && ddildo[i] == 0
||GetPlayerWeapon(i) == 11 && dildo[i] == 0||GetPlayerWeapon(i) == 12 && vibrator[i] == 0||GetPlayerWeapon(i) == 13 && svibrator[i] == 0||GetPlayerWeapon(i) == 14 && flowers[i] == 0||GetPlayerWeapon(i) == 15 && cane[i] == 0||GetPlayerWeapon(i) == 16 && grenade[i] == 0||GetPlayerWeapon(i) == 17 && tear[i] == 0||GetPlayerWeapon(i) == 18 && molotov[i] == 0||GetPlayerWeapon(i) == 22 && ninemm[i] == 0
||GetPlayerWeapon(i) == 23 && sninemm[i] == 0||GetPlayerWeapon(i) == 24 && desert[i] == 0||GetPlayerWeapon(i) == 25 && shotgun[i] == 0||GetPlayerWeapon(i) == 26 && sshotgun[i] == 0||GetPlayerWeapon(i) == 27 && cshotgun[i] == 0||GetPlayerWeapon(i) == 28 && uzi[i] == 0||GetPlayerWeapon(i) == 29 && mp5[i] == 0||GetPlayerWeapon(i) == 30 && ak47[i] == 0||GetPlayerWeapon(i) == 31 && m4[i] == 0||GetPlayerWeapon(i) == 32 && tec[i] == 0
||GetPlayerWeapon(i) == 33 && crifle[i] == 0||GetPlayerWeapon(i) == 34 && srifle[i] == 0)||GetPlayerWeapon(i) == 35 && rpg[i] == 0||GetPlayerWeapon(i) == 36 && rocket[i] == 0||GetPlayerWeapon(i) == 37 && flame[i] == 0||GetPlayerWeapon(i) == 38 && minigun[i] == 0||GetPlayerWeapon(i) == 39 && charge[i] == 0||GetPlayerWeapon(i) == 40 && detonator[i] == 0||GetPlayerWeapon(i) == 41 && spray[i] == 0||GetPlayerWeapon(i) == 42 && fire[i] == 0
||GetPlayerWeapon(i) == 43 && camera[i] == 0||GetPlayerWeapon(i) == 44 && nvission[i] == 0||GetPlayerWeapon(i) == 45 && tvission[i] == 0)
{
new pname[MAX_PLAYER_NAME], string[91];
GetPlayerName(i, pname, sizeof(pname));
format(string, sizeof(string), "Player %s is a weapon hacker, his weapons removed.", pname);
MessageToAdmins(-1,string);
ResetPlayerWeapons(i);
}
}
return 1;
}
public MessageToAdmins(color,const string[])
{
for(new a,b=GetMaxPlayers();a<b;a++)
{
if(IsPlayerAdmin(a)) SendClientMessage(a, color, string);
}
return 1;
}
D:\****\filterscripts\AntiWeap.pwn(94) : error 029: invalid expression, assumed zero
D:\****\filterscripts\AntiWeap.pwn(94 -- 95) : warning 215: expression has no effect
D:\****\filterscripts\AntiWeap.pwn(95) : error 001: expected token: ";", but found ")"
D:\****\filterscripts\AntiWeap.pwn(95) : error 029: invalid expression, assumed zero
D:\****\filterscripts\AntiWeap.pwn(95) : fatal error 107: too many error messages on one line
94: ||GetPlayerWeapon(i) == 33 && crifle[i] == 0||GetPlayerWeapon(i) == 34 && srifle[i] == 0)||GetPlayerWeapon(i) == 35 && rpg[i] == 0||GetPlayerWeapon(i) == 36 && rocket[i] == 0||GetPlayerWeapon(i) == 37 && flame[i] == 0||GetPlayerWeapon(i) == 38 && minigun[i] == 0||GetPlayerWeapon(i) == 39 && charge[i] == 0||GetPlayerWeapon(i) == 40 && detonator[i] == 0||GetPlayerWeapon(i) == 41 && spray[i] == 0||GetPlayerWeapon(i) == 42 && fire[i] == 0
95: ||GetPlayerWeapon(i) == 43 && camera[i] == 0||GetPlayerWeapon(i) == 44 && nvission[i] == 0||GetPlayerWeapon(i) == 45 && tvission[i] == 0)