/mute Command [ZCMD]
#4

It's not hard... Also, i forgot to add the key piece, in onplayertext, sorry for that :P
Here's the things you need to add (forget about the previous ones ofc)
pawn Код:
CMD:mute(playerid,params[])
{
    if(pInfo[playerid][Admin]>=3)
    {
        new plid,reason[64];
        if(sscanf(params,"us[64]",plid,reason)) return SCM(playerid,COLOR_GREY,"INFO: /mute [playerid][reason]");
        if(!IsPlayerConnected(plid)) return SCM(playerid,COLOR_GREY,"No such player");
        new adminname[MAX_PLAYER_NAME],playername[MAX_PLAYER_NAME],string[256];
        GetPlayerName(playerid,adminname,sizeof(adminname));
        GetPlayerName(plid,playername,sizeof(playername));
        format(string,sizeof(string),"[ADMIN] {%06x}%s {FF6347}was muted by {%06x}%s{FF6347}, reason: {33CCFF}%s",GetPlayerColor(plid)>>>8,playername,GetPlayerColor(playerid)>>>8,adminname,reason);
        SendClientMessageToAll(COLOR_LIGHTRED,string);
        pInfo[plid][Muted]=1;
    }
    else return SCM(playerid,COLOR_LIGHTRED,"You are not allowed to use this command!");
    return 1;
}
And I guess you may need an unmute command, just in case:
pawn Код:
CMD:unmute(playerid,params[])
{
    if(pInfo[playerid][Admin]>=3)
    {
        new plid;
        if(sscanf(params,"u",plid)) return SCM(playerid,COLOR_GREY,"INFO: /unmute [playerid][reason]");
        if(!IsPlayerConnected(plid)) return SCM(playerid,COLOR_GREY,"No such player");
        new adminname[MAX_PLAYER_NAME],playername[MAX_PLAYER_NAME],string[256];
        GetPlayerName(playerid,adminname,sizeof(adminname));
        GetPlayerName(plid,playername,sizeof(playername));
        format(string,sizeof(string),"[ADMIN] {%06x}%s {FF6347}was unmuted by {%06x}%s{FF6347}",GetPlayerColor(plid)>>>8,playername,GetPlayerColor(playerid)>>>8,adminname);
        SendClientMessageToAll(COLOR_LIGHTRED,string);
        pInfo[plid][Muted]=0;
    }
    else return SCM(playerid,COLOR_LIGHTRED,"You are not allowed to use this command!");
    return 1;
}
And this under OnPlayerText callback
pawn Код:
if(pInfo[playerid][Muted]) return SendClientMessage(playerid,COLOR_LIGHTRED,"You can't talk because you're muted!");
Reply


Messages In This Thread
/mute Command [ZCMD] - by ChristolisTV - 07.06.2015, 07:56
Re: /mute Command [ZCMD] - by Vlad64 - 07.06.2015, 08:04
Re: /mute Command [ZCMD] - by ChristolisTV - 07.06.2015, 08:28
Re: /mute Command [ZCMD] - by Vlad64 - 07.06.2015, 10:40
Re: /mute Command [ZCMD] - by ChristolisTV - 07.06.2015, 17:23

Forum Jump:


Users browsing this thread: 2 Guest(s)