Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: Doom on October 26, 2012, 07:12:37 pm

Title: Anti Insult System.
Post by: Doom 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
Title: Re: Anti Insult System.
Post by: sseebbyy on October 26, 2012, 08:07:46 pm
Nice Job !

Title: Re: Anti Insult System.
Post by: MatheuS on October 27, 2012, 06:02:19 am
NICE ONE
[/size]
Title: Re: Anti Insult System.
Post by: dynavolt71 on October 27, 2012, 07:44:10 am
Wow Thx!
Title: Re: Anti Insult System.
Post by: Doom 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
Title: Re: Anti Insult System.
Post by: heekz.shadow on October 30, 2012, 04:56:41 pm
I don't understand how .tk is an insult...
Title: Re: Anti Insult System.
Post by: VS 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]
Title: Re: Anti Insult System.
Post by: heekz.shadow 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
Title: Re: Anti Insult System.
Post by: [KB]ViceMania on December 13, 2012, 07:23:46 pm
Good job :P
Title: Re: Anti Insult System.
Post by: mrockxkingbutt 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
Title: Re: Anti Insult System.
Post by: VS on January 11, 2013, 06:10:08 pm
im going use this in my script thanks
Title: Re: Anti Insult System.
Post by: NeskWriter on January 14, 2013, 06:44:47 pm
I think it's distastefully to write all these offencive words...but...I say... GOOD WORK!