Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Easy, look you use OnPlayerUpdate(playerid)
- //So mine is like this, It's kinda simple and easy
- new WeaponHacking[MAX_PLAYERS];
- //=================================================================================================//
- //Under OnPlayerUpdate
- public OnPlayerUpdate(playerid)
- {
- //Anti Weapon Hack
- if(GetPlayerWeapon(playerid) == 1 || GetPlayerWeapon(playerid) == 2 || GetPlayerWeapon(playerid) == 5 || GetPlayerWeapon(playerid) == 6 || GetPlayerWeapon(playerid) == 7 || GetPlayerWeapon(playerid) == 8 || GetPlayerWeapon(playerid) == 10 || GetPlayerWeapon(playerid) == 11 || GetPlayerWeapon(playerid) == 12 || GetPlayerWeapon(playerid) == 13 ) //Put here the IDs of weapons you want, I'll post link after pawn.
- {
- if(PlayerInfo[playerid][pAdmin] < 10)
- {
- ResetPlayerWeapons(playerid);
- WeaponHacking[playerid] =1;
- CheatsDetected(playerid);
- return 1;
- }
- }
- if(GetPlayerWeapon(playerid) == 14 || GetPlayerWeapon(playerid) == 15 || GetPlayerWeapon(playerid) == 17 || GetPlayerWeapon(playerid) == 35 || GetPlayerWeapon(playerid) == 38 || GetPlayerWeapon(playerid) == 39 || GetPlayerWeapon(playerid) == 40 || GetPlayerWeapon(playerid) == 41 || GetPlayerWeapon(playerid) == 42 || GetPlayerWeapon(playerid) == 43 || GetPlayerWeapon(playerid) == 44 || GetPlayerWeapon(playerid) == 45)
- {
- if(PlayerInfo[playerid][pAdmin] < 10)
- {
- ResetPlayerWeapons(playerid);
- WeaponHacking[playerid] =1;
- CheatsDetected(playerid);
- return 1;
- }
- }
- //OTHER CODES
- return 1;
- }
- //=================================================================================================//
- //Now lets go to the stock CheatsDetected
- //Stock CheatsDeteceed
- stock CheatsDetected(playerid)
- {
- new string[128];
- if(WeaponHacking[playerid] == 1)
- {
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
- format(string,sizeof(string),"[ANTI CHEAT] Anti-Cheat has banned %s(%d). [Reason: Cheats Detected]",pName,playerid);
- SendClientMessageToAll(COLOR_PINK,string);
- format(string,sizeof(string),"1[ANTI CHEAT] Anti-Cheat has banned %s(%d). [Reason: Cheats Detected]",pName,playerid);
- IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
- IRC_GroupSay(gGroupID,IRC_ADMINCHANNEL,string);
- format(string, sizeof(string), "~r~BANNED!");
- GameTextForPlayer(playerid, string, 3000, 1);
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"Player's Data");
- INI_WriteString(File,"BanReason","Cheats Detected");
- INI_WriteString(File,"Reason","Weapon Hacks");
- INI_Close(File);
- PlayerInfo[playerid][pBanned] =1;
- SetTimerEx("KickPlayer",1000,false,"i",playerid);
- return 1;
- }
- return 1;
- }
- //=================================================================================================//
- //In o.3x Kick(playerid); has proirity over all codes, so you have to make a timer for it
- //like this so it posts all the codes needed before the kick
- forward KickPlayer(ID);
- public KickPlayer(ID)
- {
- Kick(ID);
- return 1;
- }
- //=================================================================================================//
- //Now lets come to OnPlayerConnect part
- //So I'm using Y_INI as you see
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- if(PlayerInfo[playerid][pBanned] == 1)
- {
- format(string,sizeof(string),"[BANNED] You are currently banned from the server. [Reason: %s]",PlayerInfo[playerid][pBanReason]);
- SendClientMessage(playerid, COLOR_RED,string);
- SendClientMessage(playerid, COLOR_RED,"[BANNED] Please Ban Appeal on our forums at www.SERVER.net");
- SetTimerEx("KickPlayer",1000,false,"i",playerid);
- return 1;
- }
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{FF0000}SERVER","{FFFFFF}Welcome back to the server! \n Type your password below to login.","Login","Quit");
- }
- //=================================================================================================//
Add Comment
Please, Sign In to add comment