Admin Chat Command and Mute
#1

I need to know how to make an admin chat command from scratch, some codes
pawn Код:
enum pInfo
{
    pPass,
    pCash,
    pScore,
    pAdminLevel,
    pKills,
    pDeaths,
    pBanned
}
new PlayerInfo[MAX_PLAYERS][pInfo];

public OnPlayerCommandText(playerid, cmdtext[])
{
    //All Player's Commands.
    dcmd(rules,5,cmdtext);
    //Admins Commands.
    if(PlayerInfo[playerid][pAdminLevel] == 1)
    {
      dcmd(ann,3,cmdtext);
      dcmd(slap,4,cmdtext);
      dcmd(acar,4,cmdtext);
      dcmd(amotor,6,cmdtext);
      return 1;
    }
    if(PlayerInfo[playerid][pAdminLevel] == 2)
    {
      dcmd(freeze,6,cmdtext);
      dcmd(unfreeze,8,cmdtext);
      dcmd(mute,4,cmdtext);
      dcmd(ann,3,cmdtext);
      dcmd(slap,4,cmdtext);
      dcmd(acar,4,cmdtext);
      dcmd(amotor,6,cmdtext);
      return 1;
    }
    if(PlayerInfo[playerid][pAdminLevel] == 3)
    {
      dcmd(freeze,6,cmdtext);
      dcmd(unfreeze,8,cmdtext);
      dcmd(mute,4,cmdtext);
      dcmd(ann,3,cmdtext);
      dcmd(slap,4,cmdtext);
      dcmd(acar,4,cmdtext);
      dcmd(amotor,6,cmdtext);
      return 1;
    }
    if(PlayerInfo[playerid][pAdminLevel] == 3)
    {
      dcmd(freeze,6,cmdtext);
      dcmd(unfreeze,8,cmdtext);
      dcmd(mute,4,cmdtext);
      dcmd(ann,3,cmdtext);
      dcmd(slap,4,cmdtext);
      dcmd(acar,4,cmdtext);
      dcmd(amotor,6,cmdtext);
      return 1;
    }
    return 1;
}
Can someone help?

Little question
pawn Код:
dcmd_mute(playerid,params[])
{
    #pragma unused params
    new pname[MAX_PLAYER_NAME];
    new string[128];
    new cmdreason[100];
    new id;
    if(sscanf(params,"us[100]",id,cmdreason))
    {
        SendClientMessage(playerid,COLOR_ERROR,"Usage: /mute (Player Name/ID) (Reason)");
        return 1;
    }
    GetPlayerName(id,pname,sizeof pname);
    if(IsMuted[id] == 1)
    {
        format(string,sizeof(string),"%s(%d) is already muted by an Administrator.",pname,id);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    IsMuted[id] =1;
    format(string,sizeof(string),"An Administrator has muted %s(%d).  (Reason: %s.)",pname,id,cmdreason);
    SendClientMessageToAll(COLOR_PINK,string);

    /*format(string,sizeof(string),"9[ADMIN] Administrator has frozen %s(%d) for reason: %s.",PlayerName(ID),ID,cmdreason);
    IRC_GroupSay(gGroupID,IRC_CHANNEL,string);*/

    return 1;
}
Everything is working, except that it's not MUTING the player.
Reply


Messages In This Thread
Admin Chat Command and Mute - by _Khaled_ - 24.08.2012, 14:05
Re: Admin Chat Command and Mute - by Calabresi - 24.08.2012, 14:43
Re: Admin Chat Command and Mute - by _Khaled_ - 24.08.2012, 16:05
Re: Admin Chat Command and Mute - by Akira297 - 24.08.2012, 16:07
Re: Admin Chat Command and Mute - by Calabresi - 24.08.2012, 16:07
Re: Admin Chat Command and Mute - by _Khaled_ - 24.08.2012, 16:12
Re: Admin Chat Command and Mute - by _Khaled_ - 24.08.2012, 16:14
Re: Admin Chat Command and Mute - by Calabresi - 24.08.2012, 16:19
Re: Admin Chat Command and Mute - by Luke_James - 24.08.2012, 16:42
Re: Admin Chat Command and Mute - by _Khaled_ - 24.08.2012, 20:11

Forum Jump:


Users browsing this thread: 5 Guest(s)