Im looking for a global chat filterscript /g (only global chat)

Safa

Well-known member
Joined
Feb 24, 2015
Messages
342
Reaction score
127
Code:
ocmd:g(playerid, params[])
{
        new str[256], text[200];
        if(sscanf(params, "s[200]", text)) return SendClientMessage(playerid, - 1, "use b1-g /g [text]");
        format(str, sizeof(str), "[Gay-Chat] %s: %s ))", PlayerName(playerid), text);
        SendClientMessageToAll(-1, str);
        return 1;
}

To use PlayerName as a function, do a stock on your own and stop asking for shitty simple chat functions that you actually learn when you start PAWN.

Code is untested, written down in 1min
 
Last edited:

Billiam

Member
Joined
Dec 2, 2018
Messages
17
Reaction score
2
Anyway I fixed it,I just need one that I can tog it like /togg or /togglobal
 

Safa

Well-known member
Joined
Feb 24, 2015
Messages
342
Reaction score
127
Create a boolean (as example):

Code:
new bool:gchat;

Then create a command for you (ex. for your admin-system) where you assign true or false (1 / 0) to the boolean.

Code:
this isnt code, just logic example:

cmd : togchat

if gchat false (0)
then gchat = true (1)
else if gchat true (1)
then gchat = false (0)

After that you go to your command to write to the g-chat and do this kind of logic:

Code:
cmd: gchat (text)

if gchat false (0) then SendClientMessage(playerid, -1, "G-Chat is not turned on"); return
// then just execute the cmd

I hope I didn't forget something and you can learn the logic / how it works.
 

Safa

Well-known member
Joined
Feb 24, 2015
Messages
342
Reaction score
127
Could you share the script please.. i really need to try it
Then try it and don't paste. And if you got problems just write here and I can help.
 
Top