[Tutorial] Anti-Flood/Swear
#1

Hello there, a very simple Anti-flood system to keep Big Mouth and Rude players away from your server.

Okay, at the Top of your script before "main()" add this:
pawn Code:
new BadWords[][] = //You can add your words.
{
  "noob",
  "n00b",
  "fuck",
  "fucker",
  "ass",
  "dick"
};
Okay, for checking if the typed word is included in The Variable "BadWords" you need to use the Variable in OnPlayerText, so under OnPlayerText add this:
pawn Code:
public OnPlayerText(playerid, text[])
{
  for(new Words; Words < sizeof(BadWords); Words++) //Sets a loop as it checks the words one by one.
  {
     if(strfind(text,BadWords[Words],true) != -1 ) // Checks if the text includes any of the defined Swear Words or not
     {
        SendClientMessage(playerid, -1, "Using Swear Words is prohibited in the chat.");
        return 0; // return 0; to avoid sending the text in chat.
     }
  }
  return 1;
}
So that's it, hope you like it and i hope this was useful... Any Comments are welcome!
Reply
#2

Great Tutorial.
Reply
#3

Quote:
Originally Posted by Inn0cent
View Post
Great Tutorial.
Thanks
Reply
#4

I cannot see Anti-Flood system and also you are not explaining the code.
Reply
#5

Nice basic tutorial, good for noobs. And as x96664 said, there's no anti-flood system and you're not explaining anything.
Reply
#6

I never really did fully understand why you wouldn't want people swearing on a game intended for people 18 years+.

OT: This isn't much of a tutorial, didn't really explain anything. But a little bit of effort is better than nothing I suppose.
Reply
#7

Quote:
Originally Posted by DanishHaq
View Post
Nice basic tutorial, good for noobs. And as x96664 said, there's no anti-flood system and you're not explaining anything.
Improved the topic, thnx for your comment.

Quote:
Originally Posted by 2KY
View Post
I never really did fully understand why you wouldn't want people swearing on a game intended for people 18 years+.

OT: This isn't much of a tutorial, didn't really explain anything. But a little bit of effort is better than nothing I suppose.
Yes true i wouldn't want this system on my own server too, but maybe some people would like to use it on their server, And improved the topic.
Reply
#8

Quote:
Originally Posted by alinategh
View Post
Improved the topic, thnx for your comment.



Yes true i wouldn't want this system on my own server too, but maybe some people would like to use it on their server, And improved the topic.
Looks better now, good job and true enough - to each his own.
Reply
#9

Quote:
Originally Posted by 2KY
View Post
I never really did fully understand why you wouldn't want people swearing on a game intended for people 18 years+.

OT: This isn't much of a tutorial, didn't really explain anything. But a little bit of effort is better than nothing I suppose.
Quote:
Originally Posted by 2KY
View Post
Looks better now, good job and true enough - to each his own.
Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)