//Antihack
#include <a_samp>
#define COLOR_YELLOW "{FFFF00}"
new Text:banmessage;
new dm[MAX_PLAYERS];
public OnFilterScriptInit()
{
printf("Anti Minigun By [A]Gamer_007 is loading now");
printf("Anti Minigun By [A]Gamer_007 loaded");
printf("NO WEAPON HACKS IN YOUR SERVER.ENJOY");
banmessage = TextDrawCreate(190,200,"~r~Nice Hacks but Here they are not allowed.~n~~y~You are banned from this server.");
TextDrawFont(banmessage, 2);
TextDrawLetterSize(banmessage, 0.6, 1.0);
TextDrawSetShadow(banmessage, 0);
TextDrawSetOutline(banmessage, 1);
return 1;
}
stock PlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
CMD:dm(playerid,parms[])
{
dm(playerid) = 1;//set a palyer dm value to 1
//My tele co ordinate here
return 1;
}
public OnPlayerUpdate(playerid)
{
if(dm(playerid) == 1){
return 1;
}
else
{
new string[128],Weapon,Ammo;
GetPlayerWeaponData(playerid, 7, Weapon,Ammo);
if(Weapon == 38 && !IsPlayerAdmin(playerid)) {
format(string,128,"{FF0000}%s[%d] Has Been Banned From Server.[Reason: Minigun Hack]",PlayerName(playerid),playerid);
SendClientMessageToAll(0xFF0000AA,string);
TextDrawShowForPlayer(playerid, banmessage);
Ban(playerid);
}
if(Weapon == 36 && !IsPlayerAdmin(playerid)) {
format(string,128,"{FF0000}%s[%d] Has Been Banned From Server.[Reason: Heat Saker Hack]",PlayerName(playerid),playerid);
SendClientMessageToAll(0xFF0000AA,string);
TextDrawShowForPlayer(playerid, banmessage);
Ban(playerid);
}
if(Weapon == 35 && !IsPlayerAdmin(playerid)) {
format(string,128,"{FF0000}%s[%d] Has Been Banned From Server.[Reason: Rocket Launcher Hack]",PlayerName(playerid),playerid);
SendClientMessageToAll(0xFF0000AA,string);
TextDrawShowForPlayer(playerid, banmessage);
Ban(playerid);
}
return 1;
}
C:\Users\DEVILS\Desktop\tri.pwn(2 : error 021: symbol already defined: "dm" C:\Users\DEVILS\Desktop\tri.pwn(2 : error 021: symbol already defined: "dm" C:\Users\DEVILS\Desktop\tri.pwn(31) : error 010: invalid function or declaration C:\Users\DEVILS\Desktop\tri.pwn(35) : error 012: invalid function call, not a valid address C:\Users\DEVILS\Desktop\tri.pwn(35) : warning 215: expression has no effect C:\Users\DEVILS\Desktop\tri.pwn(35) : error 001: expected token: ";", but found ")" C:\Users\DEVILS\Desktop\tri.pwn(35) : error 029: invalid expression, assumed zero C:\Users\DEVILS\Desktop\tri.pwn(35) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 6 Errors. |
C:\Users\DEVILS\Desktop\tri.pwn(2 : error 021: symbol already defined: "dm" C:\Users\DEVILS\Desktop\tri.pwn(31) : error 010: invalid function or declaration C:\Users\DEVILS\Desktop\tri.pwn(6 : error 030: compound statement not closed at the end of file (started at line 35) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors. |
Use a timer. OnPlayerUpdate is worst thing callback to use for Anti-Cheats.
|
#include <zcmd>