SA-MP Forums Archive
OnPlayerText [HELP] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerText [HELP] (/showthread.php?tid=149718)



OnPlayerText [HELP] - Jay. - 23.05.2010

Hey guy's erm i was working on a script with OnPlayerText & if the player swears for this example its "fuck you"


heres my code



Код:
public OnPlayerText(playerid, text[])
{
  if (strfind(text, "fuck you") != -1)
  {
   new string[80], name[MAX_PLAYER_NAME];
   GetPlayerName(playerid, name, sizeof(name));
   format(string, sizeof(string), "%s! Has been muted for 5 seconds for flaming.", name);
   SendClientMessageToAll(0xFFFF00FF,string);
    

  }
	return 1;
}
So how can i make this mute the player if he says fuck you?

Reply if ya can help thanks.


Re: OnPlayerText [HELP] - RyDeR` - 23.05.2010

In this way, it's slower and longer.
Create a multidimensional array and put all words that are disabled in it.
Then use a loop to check if it's in there.
So if use PVar to set muted to 1.
Then under OnPlayerText
if muted == 1 then return 0;

Understand the point of it?
So actually return 0; it to let him mute.


Re: OnPlayerText [HELP] - MenaceX^ - 23.05.2010

Use a variable.



Re: OnPlayerText [HELP] - Jay. - 23.05.2010

Quote:
Originally Posted by » RyDeR «
In this way, it's slower and longer.
Create a multidimensional array and put all words that are disabled in it.
Then use a loop to check if it's in there.
So if use PVar to set muted to 1.
Then under OnPlayerText
if muted == 1 then return 0;

Understand the point of it?
So actually return 0; it to let him mute.
Sorry i'm a begginer i have no idea what you mean i'm trying to do it this way.

But maybe a example?