Block out the chat
#1

Hello
is there a function to make the chat invisible to a certain player?

AKA: Make it so that what people are saying doesn't appear on their chat.

Thanks

Reply
#2

Код:
public OnPlayerText(playerid, text[])
{
    return 0;
}
Reply
#3

thanks
Reply
#4

Quote:
Originally Posted by » RyDeR «
Код:
public OnPlayerText(playerid, text[])
{
    return 0;
}
That means NOBODY will be able to chat at all. I think he wants for a specific player to not be able to see chat, and I don't think that's possible
Reply
#5

Quote:
Originally Posted by biltong
Quote:
Originally Posted by » RyDeR «
Код:
public OnPlayerText(playerid, text[])
{
    return 0;
}
That means NOBODY will be able to chat at all. I think he wants for a specific player to not be able to see chat, and I don't think that's possible
sure it is, ever heard of a /mute command ?

pawn Код:
if((strcmp("mute", cmdtext[1], true, 4) == 0) && (cmdtext[5] == ' ' || cmdtext[5] == EOS))
{
    if(cmdtext[5] == ' ')
    {
        if('0' <= cmdtext[6] && cmdtext[6] <= '9')
        {
            if(SetPVarInt(strval(cmdtext[6]), "Muted", 1))
                return SendClientMessage(playerid, 0xFFFFFFAA, "Player muted!");
            return SendClientMessage(playerid, 0xFFFFFFAA, "Invalid playerid!");
        }
    }
    return SendClientMessage(playerid, 0xFFFFFFAA, "Right Usage: /mute [playerid]");
}
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(GetPVarInt(playerid, "Muted")) return 0;
}
pawn Код:
if((strcmp("unmute", cmdtext[1], true, 6) == 0) && (cmdtext[7] == ' ' || cmdtext[7] == EOS))
{
    if(cmdtext[7] == ' ')
    {
        if('0' <= cmdtext[8] && cmdtext[8] <= '9')
        {
            if(IsPlayerConnected((cmdtext[0] = strval(cmdtext[8]))))
            {
                if(GetPVarInt(cmdtext[0], "Muted"))
                {
                    DeletePVar(cmdtext[0], "Muted");
                    return SendClientMessage(playerid, 0xFFFFFFAA, "Player unmuted!");
                }
                return SendClientMessage(playerid, 0xFFFFFFAA, "Player not muted!");
            }
            return SendClientMessage(playerid, 0xFFFFFFAA, "Invalid playerid!");
        }
    }
    return SendClientMessage(playerid, 0xFFFFFFAA, "Right Usage: /unmute [playerid]");
}
Reply
#6

That will make sure he can't chat, but he will still be able to see other people's chat which is what I meant, him not being able to see other people's chat.
Reply
#7

Ok, so with this he wont be able to see the text what other wrote (if Invisable isnt 0)

pawn Код:
public OnPlayerText(playerid, text[])
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(GetPVarInt(i, "Invisible") == 0)
            SendPlayerMessageToPlayer(i, playerid, text);
    }
    return 0;
}
But he still can write in the chatbox and other will see it (even he self doesnt)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)