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

Quote:
Originally Posted by ccodey
Посмотреть сообщение
Hey, that looks really clean and seemed like it fixed my issues. Care to explain what you changed?
Код:
CMD:mute(playerid,params[])
{
        new targetid,string[128];
        if(Muted[playerid] == 0) // this mute check should be under sscanf and you are checking if you are muted yourself instead of the target player.
        {
                if(PlayerInfo[playerid][pAdmin] >1) // I check if player admin level is 0, what you did here is also correct.
                {
                    if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, -1, "Syntax - /mute [playerid]"); 
                    {
                        Muted[playerid] = 1; // same here, instead of muting the targetid - you mute yourself.
                        format(string,sizeof(string), "%s has been muted by an administrator.",targetid); // you are quoting the targetid, not targetname. To get targetname, you need to create a different variable for that and use GetPlayerName. 
                        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)