pls help, the other func is not working
#1

Код:
public OnPlayerText(playerid, text[])
{
    //Mute Player//
    if(Mute[playerid] == 1)
    {
        return 0;
    }
     if(Mute[playerid] == 0)
    {
     return 1;
    }
    new pName[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, pName, sizeof(pName));

  	if(text[0] == '!')
    {
    format(string, sizeof(string), "[TeamChat] "COL_WHITE"%s: "COL_GREEN"(%i) %s", pName, playerid, text[1]);
    printf("%s", string);
    for(new i=0,b=GetMaxPlayers();i<b;i++)
    {
            if(gTeam[i] == gTeam[playerid]) SendClientMessage(i, GetPlayerColor(playerid), string);
        }
    return 0;
	}
    format(string, sizeof(string), "(%i) %s",playerid, text);
    SendPlayerMessageToAll(playerid, string);
    return 0;
}
mute is work
but Team chat is not working

what should i do, pls help
Reply
#2

That is because you're stopping the code whether or not their muted.
pawn Код:
if(Mute[playerid] == 0)
    {
     return 1;
    }
This code checks if the player is not muted, and lets them send the default message. Remove this section of the code and the rest of the callbacks code will be executed.
Reply
#3

so, how i unmuted player

Reply
#4

How do you unmute a player? You set the player-variable 'Mute' to zero.
Reply
#5

im newb,,, i just searched that func in this forum, how to fix??
Reply
#6

I cannot understand what you're asking. If you want to enable team chat to work correctly, then remove the code I provided to you in my first response from the OnPlayerText callback. If you want to un-mute the player after they have been muted, you will need to set their variable to zero, like below:
pawn Код:
Mute[ playerid ] = 0;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)