Author Topic: anti-clan and anti-insult system for noobs  (Read 4 times)

Offline (R2x)spider

  • Administrator
  • Newbie
  • *****
  • Posts: 30
    • View Profile
anti-clan and anti-insult system for noobs
« on: February 03, 2013, 05:44:46 pm »
hi all
i think even some advanced scripters wont know that, but, i will show you some of the 2 systems ive made
the anti insult works like that: if like anyone types a abusing word example "monfuck" it detects the "****" and kicks them 100% tested even if they type "you fucker" it detects "****" and kicks them. Here is the code

This is the anti insult system

Put this under onplayertext

Pawno Code: [Select]
public OnPlayerText(playerid, cmdtext[])//you may have OnPlayerText(playerid) change it to OnPlayerText(playerid, cmdtext)
CheckInsult(playerid, cmdtext);

Make a public CheckInsult(playerid, c[])
Pawno Code: [Select]
   new cde[256]; cde = "CountRegisters";
   if (strfind(c, "****", true) != -1 || strfind(c, "*****", true) != -1 ) Kicks(playerid, "Insulting Admins/Players");
   if (strfind(c, "******", true) != -1 || strfind(c, "bullshit", true) != -1 ) Kicks(playerid, "Insulting Admins/Players");
   if (strfind(c, "ass", true) != -1 || strfind(c, "stupid", true) != -1 ) Kicks(playerid, "Insulting Admins/Players");
   if (strfind(c, "gay", true) != -1 || strfind(c, "sexy", true) != -1 ) Kicks(playerid, "Insulting Admins/Players");
    return 0;

this is the anti-clancheat system

Put this under public OnPlayerCommandText(playerid, cmdtext)
Pawno Code: [Select]
public OnPlayerCommandText(playerid, cmdtext)
      if (strcmp(cmd, "clan", true) == 0) {
      tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
      if (IsLevel(playerid,6)) return 0;//Change IsLevel(playerid,6) to what you use to check if player is a admin
      else if (!strlen(tmp)) SendClientMessage(playerid, GREEN,"ERROR: Invalid Syntax - Use  /c %s <playerid/name>.",cmdtext);
      else {
           if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid, GREEN,"ERROR: Unknown player."); else {
                pInfo[plr][ClanUSA] = 1;//Change it to what you use as PlayerInfo
               }
      }
      return 1;
   }

Put this under OnPlayerSpawn(playerid,classid,teamid)
Pawno Code: [Select]
public OnPlayerSpawn(playerid,classid,teamid)
    if (pInfo[playerid][ClanUSA] = 0) {
   NickPlayerChar(playerid);
    }

Make a public NickPlayerChar(playerid)
Pawno Code: [Select]
public NickPlayerChar(playerid)
{

    if(IsInClan(gPlayers[playerid]))
   {
   SendClientMessage(playerid, COLOR_RED, "CONNECTION REJECTED");
   SendClientMessage(playerid, COLOR_RED, "YOU HAVE BEEN KICKED");
   SendClientMessage(playerid, COLOR_RED, "ADMIN: SYSTEM REASON: NOT IN CLAN USA");
   Kick(playerid);
   SendClientMessageToAll(playerid, COLOR_RED, "Admin System kicked %s. Reason: Not in clan USA",gPlayers[playerid]);
   }
}

Now make a public IsInClan(c)
Pawno Code: [Select]
public IsInClan(c&#91;])
{
   new cde[256]; cde = "CountRegisters";
   if (strfind(c, "USA", true) != -1) return 1;//Replace USA with your clan
        else return 0;
    return 1;
}


Now here you have them. Now you have a insult-free and clancheat-free server!
You might have some warnings, but ignore them its tested 100% works

Share on Bluesky Share on Facebook