Automute for Swearing
#1

Hi, I was looking for an automute but I couldn't find a good one anywhere

Please can you help me to script an automute code, or help finding me a ready script? Help would be appreciated.

I am looking for a script that mutes chosen swear words by me, and that mutes for a spam. Please help me with that. And I would like it to say ''The bot has muted you for 15 seconds - Reason: (Swearing/Spamming whatever)...''

Thanks And Regards
Puzi
Reply
#2

Search for "swear" in the filterscripts sub, I'm sure Boylett released such a script.
Reply
#3

Here it is Not Tested
pawn Код:
new Muted[MAX_PLAYERS];

public OnPlayerCommandText(playerid, text[])
{
  if (Muted[playerid]) { SendClientMessage(playerid, 0xFF0000FF, "You are muted, you cannot speak!"); return 0; }
  if (strfind(text, "noob", true) != -1 ||
    strfind(text, "asshole", true) != -1 ||
    strfind(text, "n00b", true) != -1
  )
  {
    Muted[playerid] = true;
    SendClientMessage(playerid, 0xFF0000FF, "You got muted for swearing!");
  }
}
At as many words as you can by copying the 7th line and change the word asshole to anything you want. You can change noob and n00b ofcourse too if you like.

But i prefer Censoring (or something)
It changes the word to Stars (*)
There is a snipped posted here somewhere.
The code is even shorten then this one.

Quote:
Originally Posted by Donny
Search for "swear" in the filterscripts sub, I'm sure Boylett released such a script.
I know, this is the one i ment with Censoring, it replaces the word with stars (*)
Reply
#4

It works but when I compile i get Windows Error =/ Please help.

//edit: I don't mean stars because its not good for me. Punishment is better I think =) Btw, I wanted a Time limit for it like 15/20 secs so it unmutes after that time automatically.
Reply
#5

Please help.

Sry for DB.
Reply
#6

Quote:
Originally Posted by Puzi
It works but when I compile i get Windows Error =/ Please help.

//edit: I don't mean stars because its not good for me. Punishment is better I think =) Btw, I wanted a Time limit for it like 15/20 secs so it unmutes after that time automatically.
So it doesn't work xD

Fix i hope:
pawn Код:
new Muted[MAX_PLAYERS];

public OnPlayerText(playerid, text[])
{
  if (Muted[playerid]) { SendClientMessage(playerid, 0xFF0000FF, "You are muted, you cannot speak!"); return 0; }
  if (strfind(text, "noob", true) != -1 ||
    strfind(text, "asshole", true) != -1 ||
    strfind(text, "n00b", true) != -1
  )
  {
    Muted[playerid] = true;
    SendClientMessage(playerid, 0xFF0000FF, "You got muted for swearing!");
    SetTimerEx("UnMuted", 20000, 0, "d", playerid);
  }
}

public UnMuted(playerid)
{
  Muted[playerid] = false;
  return 1;
}
This will work i hope. This also unmutes the player after 20 seconds (changeble, by changing the 20000 at SetTimerEx, to the miliseconds to wait till unmute
Reply
#7

Also, put
pawn Код:
forward UnMuted(playerid);
a line before public UnMuted(playerid)
Reply
#8

Seems to be working, only one error to get rid of (Warning actually lol)

Код:
C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1829) : warning 235: public function lacks forward declaration (symbol "UnMuted")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
//edit: Lol, i think you've read my mind xD. Thanks Its now Working =)))))
Reply
#9

Quote:
Originally Posted by Puzi
Seems to be working, only one error to get rid of (Warning actually lol)

Код:
C:\DOCUME~1\KAMIL\Pulpit\RPGTDM~1\RPG.pwn(1829) : warning 235: public function lacks forward declaration (symbol "UnMuted")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
//edit: Lol, i think you've read my mind xD. Thanks Its now Working =)))))
Look at the post by dice7, i forgot that line.
Reply
#10

Yeap, I did look at that before you posted =)

But, erm, It works perfectly in script, although my f*cking server crashes Please help, maybe the string is wrong or something? Here is the log...

Код:
--------------------------

Exception At Address: 0x0047C8C6

Registers:
EAX: 0x00000000	EBX: 0x011B6764	ECX: 0x00000000	EDX: 0x0012F1E0
ESI: 0x0012F1E0	EDI: 0x0012F3E0	EBP: 0x0012EE94	ESP: 0x0012EE10
EFLAGS: 0x00010246

Stack:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)