I can't get my /unmute to work properly.
#1

I made a /mute & /unmute command. The /mute command works, but I can't then un-mute the player again.
I appreciate any help.

Код:
new Muted[MAX_PLAYERS];
Код:
public OnPlayerText(playerid, text[])
{
        if(Muted[playerid] == 1)
        {
                SendClientMessage(playerid,-1,"You are currently muted, you can not talk in chat.");
                return 0;
        }
        return 1;
}
MUTE:

Код:
CMD:mute(playerid,params[])
{
        new targetid,string[128];
        if(Muted[playerid] == 0)
        {
                if(PlayerInfo[playerid][pAdmin] >1)
                {
                    if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, -1, "Syntax - /mute [playerid]");
                    {
                        Muted[playerid] = 1;
                        format(string,sizeof(string), "%s has been muted by an administrator.",targetid);
                        SendClientMessageToAll(-1, string);
                     }

                     }
                 }   
            
        return 1;
 }
UN-MUTE

Код:
CMD:unmute(playerid,params[])
{
        new targetid, string[128];
        if(Muted[playerid] == 1)
        {
                if(PlayerInfo[playerid][pAdmin] >1)
                {
                        if(sscanf(params,"u",targetid)) return SendClientMessage(playerid, -1, "Syntax - /unmute [playerid]");
                        {
                            Muted[playerid] = 1;
                            format(string,sizeof(string),"%s has been un-muted by an administrator.",targetid);
                            SendClientMessageToAll(-1, string);
                        }
                }
        }
        return 1;
}
Reply


Messages In This Thread
I can't get my /unmute to work properly. - by ccodey - 28.02.2017, 11:35
Re: I can't get my /unmute to work properly. - by TopShooter2 - 28.02.2017, 11:37
Re: I can't get my /unmute to work properly. - by ccodey - 28.02.2017, 11:58
Re: I can't get my /unmute to work properly. - by Sabur - 28.02.2017, 12:03
Re: I can't get my /unmute to work properly. - by ccodey - 28.02.2017, 12:07
Re: I can't get my /unmute to work properly. - by Sew_Sumi - 28.02.2017, 12:14
Re: I can't get my /unmute to work properly. - by Sabur - 28.02.2017, 12:15
Re: I can't get my /unmute to work properly. - by Sew_Sumi - 28.02.2017, 12:17
Re: I can't get my /unmute to work properly. - by ccodey - 28.02.2017, 12:17

Forum Jump:


Users browsing this thread: 1 Guest(s)