SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 30/01/2010, 06:45 AM   #1
E-Rage
Little Clucker
 
Join Date: Jan 2010
Posts: 34
Reputation: 0
Default problem with bad words

Code:
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(84) : warning 217: loose indentation
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(100) : error 017: undefined symbol "mutecount"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(100) : warning 215: expression has no effect
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(100) : error 001: expected token: ";", but found "]"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(100) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(100) : fatal error 107: too many error messages on one line

Code:
forward UnMuteEm(playerid);
new muted[MAX_PLAYERS]; // muted variable
new mutedcount[MAX_PLAYERS]; // how many mutes variables
new chatcount[MAX_PLAYERS]; // how many times chat bad words

public OnPlayerText(playerid, text[])
{
if(muted[playerid] == 1) return 0; // he cannot talk if hes muted
else if(strfind(text, "eyehole", true) > -1) // here we check if he's saying a bad word, "eyehole" should be remplaced
{
if(chatcount[playerid] > 1) // if he has 2 or more he's gonna be muted
{
if(mutecount[playerid] > 2) // if he has been muted more than twice he's going to be kicked
{
SendClientMessage(playerid, COLOR, "You have been kicked out for saying bad words!");
Kick(playerid);
}
else // if he has not, then:
{
SendClientMessage(playerid, COLOR, "You have been muted because saying bad words!");
chatcount[playerid] = 0;
muted[playerid] = 1;
SetTimerEx("UnMuteEm", 180 * 1000, false, "d", playerid);
mutecount[playerid] ++;
}
}
else // if he doesn't even have morae that one chat count then add 1 more
{
SendClientMessage(playerid, COLOR, "Don't say bad words!");
chatcount[playerid] ++;
return 0; // return 0 means the text is not gonna be showed
}
}
return 1;
}

public UnMuteEm(playerid) // to unmute him
{
muted[playerid] = 0;
SendClientMessage(playerid, COLOR, "You have been unumuted!");
return 1;
}

new Badwords[][] =
{
"Fuck",
"Shit",
 "Nigger",
 "Crap"
}; //Just add more using , and quote them.
new Muted[MAX_PLAYERS];

public OnPlayerText(playerid, text[])
{
for(new Z; Z<sizeof(Badwords); Z++)
{
  if(strfind(text, Badwords[Z], true))
  {
    Muted[playerid] ++;
    SetTimerEx("Unmute", 180000, false, "d", playerid);
    SendClientMessage(playerid, COLOR, "You have been muted for 3 minutes for saying bad words!");
return 0;
}
}
if(Muted[playerid] == 1)
{
  SendClientMessage(playerid, COLOR, "You are muted");
  return 0;
}
return 1;
}

forward Unmute(playerid);
public Unmute(playerid)
{
  Muted[playerid] --;
  SendClientMessage(playerid, COLOR, "You have been unmuted, DON'T REPEAT IT!");
return 1;
}



 Report to moderator  Logged

--------------------------------------------------------------------------------

Cheapest New Zealand VPS
why did this happend ?
E-Rage is offline  
Old 30/01/2010, 11:03 AM   #2
smeti
Huge Clucker
 
smeti's Avatar
 
Join Date: Sep 2008
Posts: 326
Reputation: 32
Default Re: problem with bad words



pawn Code:
new mutedcount[MAX_PLAYERS]; // how many mutes variables

C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(100) : error 017: undefined symbol "mutecount"

if(mutecount[playerid] > 2) // if he has been muted more than twice he's going to be kicked
mutecount[playerid]++;

//And:
if(strfind(text, Badwords[Z], true) != -1)
smeti is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add color to Words like words in /commands Badandy Help Archive 17 18/05/2010 01:51 PM
bad words help ~Dangun! Help Archive 5 31/01/2010 12:05 AM
Words Abernethy Everything and Nothing 31 09/12/2009 06:31 PM
Words with /, \, _, -, l, | Abernethy Everything and Nothing 7 11/06/2009 03:13 PM
Bad Words GeKo Help Archive 2 27/05/2009 12:03 PM


All times are GMT. The time now is 01:36 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.