Author Topic: Anti Insult System.  (Read 8478 times)

0 Members and 1 Guest are viewing this topic.

Offline Doom

  • Made Man
  • ***
  • Posts: 105
    • View Profile
Anti Insult System.
« on: October 26, 2012, 07:12:37 pm »
Hello guys my first day, my first topic and my first release for you all.

Note: This is for you to learn no matter if you only copy/paste butmake sure to learn from it, will help you alot in future scripting.

What does it do?

♦ This script will filter out all offensive words in the text a player types, if it finds any it will warn the player 5 times and after that kick

How many languages are there to choose from?

♦ English, Use the same method to add other languages.

Warning: Use 1 Language at a time for example if you want to use spanish instead of english copy  baste the english words code and add the spanish offensive words after that comment the english code and don, if you want to use english then un-comment and comment spanish not that much hard

Featured languages:
add much languages you want but 1 at a time

Why can you only pick 1 language at a time?

♦ This has 2 reasons, the first one is to reduce lagg since the script must loop through all possible words, if you would put in all the languages it had to loop through 1000+ words for every line of text a player types, typically this would induce lagg. The second reason is because some words in one language are not offensive in another, putting in all languages would cause the script to censor waaay to much words initially not ment to be offensive.

time for coding.

Top of Script:

Code: [Select]
#define MAX_WORD_LEN 18 // Max lenght of a swear word
#define MAX_WORDS 122   // Max amount of swearwords
#define MAX_SWEARCOUNT 5 // Max warnings before kick

Code: [Select]
// ENGLISH
new swear[][MAX_WORD_LEN] =
{
{"anus"},
{"arsehole"},
{"ass"},
{"bitch"},
{"blowjob"},
{"boner"},
{"bullshit"},
{"clit"},
{"cock"},
{"cum"},
{"cunt"},
{"dick"},
{"dildo"},
{"douche"},
{"fag"},
{"fellatio"},
{"fuck"},
{"fudgepacker"},
{"gay"},
{"damn"},
{"gooch"},
{"handjob"},
{"hard-on"},
{"homo"},
{"homodumbshit"},
{"humping"},
{"jerkoff"},
{"jigaboo"},
{"jizz"},
{"jungle-bunny"},
{"junglebunny"},
{"kooch"},
{"kootch"},
{"kunt"},
{"kyke"},
{"lesbian"},
{"lesbo"},
{"lezzie"},
{"mcfagget"},
{"minge"},
{"mothafucka"},
{"motherfucker"},
{"motherfucking"},
{"muff"},
{"muffdiver"},
{"munging"},
{"negro"},
{"*****"},
{"niglet"},
{"nutsack"},
{"paki"},
{"panooch"},
{"pecker"},
{"peckerhead"},
{"penis"},
{"piss"},
{"polesmoker"},
{"pollock"},
{"poonani"},
{"porchmonkey"},
{"prick"},
{"punanny"},
{"punta"},
{"pussies"},
{"pussy"},
{"pussylicking"},
{"puto"},
{"queef"},
{"renob"},
{"rimjob"},
{"ruski"},
{"sand******"},
{"schlong"},
{"scrote"},
{"shit"},
{"shiz"},
{"shiznit"},
{"skank"},
{"skullfuck"},
{"slut"},
{"slutbag"},
{"smeg"},
{"snatch"},
{"tard"},
{"testicle"},
{"thundercunt"},
{"tit"},
{"twat"},
{"twatwaffle"},
{"unclefucker"},
{"vag"},
{"vagina"},
{"vjayjay"},
{"wank"},
{"whore"},
{"whorebag"},
{"whoreface"},
{"wop"},
{"@gmail"},
{"@live"},
{"@msn"},
{"@hotmail"},
{".de"},
{".cc"},
{"www."},
{".com"},
{".co"},
{".uk"},
{".org"},
{".net"},
{".info"},
{".tk"}
};

Code: [Select]
new swearCount[MAX_PLAYERS];
public OnPlayerDisconnect(playerid, reason){
swearCount[playerid] = 0;
}

paste it like that with onplayerdissconnect

Code: [Select]
public OnPlayerText(playerid, cmdtext[])
{
if((strlen(cmdtext) < 3) || (cmdtext[0] == '/') || (cmdtext[0] == '#') || (cmdtext[0] == '!')) return 1;

new offset;
new len;
  for(new i=0; i<MAX_WORDS; i++)
{
offset = strfind(cmdtext, swear[i], true);
if(offset > -1)
{
len = strlen(swear[i]);
if(len < 3) break;
for(new y=0; y<len; y++)
{
cmdtext[offset+y] = '*';
}
swearCount[playerid]++;
new string[64];
format(string, sizeof(string), "Swearing is not allowed here, warning %d/%d", swearCount[playerid], MAX_SWEARCOUNT);
SendClientMessage(playerid, 0xE60000FF, string);
    if(swearCount[playerid] >= MAX_SWEARCOUNT)
{
    new name[24];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "*** %s has been kicked for offensive language", name);
    SendClientMessageToAll(0xE60000FF, string);
    Kick(playerid);
    break;
}
break;
}
}
return 1;
}

the onplayeretext sure you can just copy the main thing lol not the whole onplayertext because it will make problem with ur commands

Feel free to post any bugs you find ;)

Credits

• Sinner
• Wikipedia for a considerable part of the words
« Last Edit: October 27, 2012, 11:14:39 am by Doom »

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Anti Insult System.
« Reply #1 on: October 26, 2012, 08:07:46 pm »
Nice Job !


Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline MatheuS

  • Made Man
  • ***
  • Posts: 207
  • Pawn And Squirrel Scripter
    • View Profile
    • Brazillian Community
Re: Anti Insult System.
« Reply #2 on: October 27, 2012, 06:02:19 am »
NICE ONE[/size]

Offline dynavolt71

  • Crime Boss
  • ****
  • Posts: 371
    • View Profile
    • My Blog
Re: Anti Insult System.
« Reply #3 on: October 27, 2012, 07:44:10 am »
Wow Thx!
[PAWNO]Fix Error " Failed to set data for "" " - http://forum.vicecitymultiplayer.com/index.php?topic=5743.0



:'(

Offline Doom

  • Made Man
  • ***
  • Posts: 105
    • View Profile
Re: Anti Insult System.
« Reply #4 on: October 27, 2012, 08:02:50 am »
Thanks all, as i am samp scripter but i made this with my friend for vcmp and the fact the client chat is bugged if it was fixed that the client message can be updated to it would show that if someone says ass hole in chat it would say *** hole but client bug comes in way so there gets no ** and just a warning, i hope you understand.

Thanks again Enjoy
« Last Edit: July 13, 2013, 06:10:26 pm by Doom »

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Anti Insult System.
« Reply #5 on: October 30, 2012, 04:56:41 pm »
I don't understand how .tk is an insult...
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline VS

  • Street Thug
  • *
  • Posts: 37
  • Opening Soon - VS Society
    • View Profile
Re: Anti Insult System.
« Reply #6 on: November 27, 2012, 07:58:08 pm »
.tk isn't an insult its a Domain name and that's advertising and instead of kicking the user try this so you don't loose members to your server
[pawn]
    for(new i = 0; i < 100; i++)
    {
        SendClientMessage(i, -1, "");
    }
[/pawn]
« Last Edit: November 27, 2012, 08:03:41 pm by VS »

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Anti Insult System.
« Reply #7 on: November 28, 2012, 03:17:57 pm »
.tk isn't an insult its a Domain name and that's advertising and instead of kicking the user try this so you don't loose members to your server
[pawn]
    for(new i = 0; i < 100; i++)
    {
        SendClientMessage(i, -1, "");
    }
[/pawn]

Thanks genius, I never know.

sarcasm
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline [KB]ViceMania

  • Wiseguy
  • **
  • Posts: 53
  • Mega War server administrator
    • View Profile
Re: Anti Insult System.
« Reply #8 on: December 13, 2012, 07:23:46 pm »
Good job :P

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Re: Anti Insult System.
« Reply #9 on: December 26, 2012, 11:20:20 pm »
how to install this in gups i really need this system in my server many abuser come in server thats bad
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline VS

  • Street Thug
  • *
  • Posts: 37
  • Opening Soon - VS Society
    • View Profile
Re: Anti Insult System.
« Reply #10 on: January 11, 2013, 06:10:08 pm »
im going use this in my script thanks

Offline NeskWriter

  • Crime Boss
  • ****
  • Posts: 355
    • View Profile
Re: Anti Insult System.
« Reply #11 on: January 14, 2013, 06:44:47 pm »
I think it's distastefully to write all these offencive words...but...I say... GOOD WORK!


-Funniest quotes-

Quote from: asad3man
i cant able to understand