22.09.2013, 14:06
(
Last edited by alinategh; 22/09/2013 at 04:32 PM.
Reason: Improving
)
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:
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:
So that's it, hope you like it and i hope this was useful... Any Comments are welcome!
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"
};
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;
}