problem with bad words
#1

Код:
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
Код:
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 ?
Reply
#2



pawn Код:
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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)