OnPlayerText - 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)
+--- Thread: OnPlayerText (
/showthread.php?tid=548215)
OnPlayerText -
HY - 28.11.2014
Hello, I'm trying to make an Forbidden Words System. I have this:
pawn Код:
public OnPlayerText(playerid, text[])
{
new name[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid, name, sizeof(name));
if(strfind("gay", "gay", true) != -1)
{
format(string, sizeof(string), "{FF0000}%s {15FF00}(%d) {FFFF00}: {FFCC33}Adaugati la favorite server-ul!", name, playerid);
SendClientMessageToAll(-1, string);
}
return 1;
}
It's workin' fine, but, there's a way, if he say the word from strfind don't send it? And says too all players only text I put?
Re: OnPlayerText -
Sawalha - 28.11.2014
Can you explain more please? I can't understand you probably
Re: OnPlayerText -
HY - 28.11.2014
If he write in chat the word from strfind, from pawn code, don't send it. Just send the format wich I writed up.
Re: OnPlayerText -
Vince - 28.11.2014
Return 0.
Re: OnPlayerText -
LeXuZ - 28.11.2014
If you want to replace the word, like gay when someones says it, lets say it puts g**, then use something like this
http://pastebin.com/tdjZ1SUP, it's from my brother, it works perfectly, you could learn how to use it from here (Don't just copy and paste)