open.mp forum
[Pawn] Help!Restrict player chat - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] Help!Restrict player chat (/showthread.php?tid=2181)



Help!Restrict player chat - Jian_han - 2021-07-18

such as

Players are forbidden to send a message containing fu?k

Not sent fuck, but included ?f?ck?. I will thank you very much,



I am noob,pls?Please give me a complete document?

I very need it!!!!?

thank you


RE: Help!Restrict player chat - Radical - 2021-07-18

Code:
new Insults[][] = {

? ? {"Word"},

? ? {"Word"},

? ? {"Word"}

}



IsTextContainsInsults(const text[]) {

? ? for(new i; i < sizeof Insults; i)

? ? ? ? if(strfind(text, Insults[i], true) != -1) return 1;



? ? return 0;

}



public OnPlayerText(playerid, text[]) {



? ? if(IsTextContainsInsults(text)) {

? ? ? ? SendClientMessage(playerid, -1, "Your text has been blocked due?to contains insults.");

? ? return 0;

? ? }



? ? return 1;

}



This is a simple example of blocking?words.?

You have to block those words yourself.


RE: Help!Restrict player chat - Jian_han - 2021-07-18

thank