[Tutorial] Anti-Flood/Swear - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Tutorials (
https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] Anti-Flood/Swear (
/showthread.php?tid=465475)
Anti-Swear -
alinategh - 22.09.2013
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!
Re: Anti-Flood/Swear -
Inn0cent - 22.09.2013
Great Tutorial.
Re: Anti-Flood/Swear -
alinategh - 22.09.2013
Quote:
Originally Posted by Inn0cent
Great Tutorial.
|
Thanks
Re: Anti-Flood/Swear -
x96664 - 22.09.2013
I cannot see Anti-Flood system and also you are not explaining the code.
Re: Anti-Flood/Swear -
DanishHaq - 22.09.2013
Nice basic tutorial, good for noobs. And as x96664 said, there's no anti-flood system and you're not explaining anything.
Re: Anti-Flood/Swear -
2KY - 22.09.2013
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.
Re: Anti-Flood/Swear -
alinategh - 22.09.2013
Quote:
Originally Posted by DanishHaq
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
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.
Re: Anti-Flood/Swear -
2KY - 22.09.2013
Quote:
Originally Posted by alinategh
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.
Re: Anti-Flood/Swear -
alinategh - 22.09.2013
Quote:
Originally Posted by 2KY
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
Looks better now, good job and true enough - to each his own.
|
Thank you