Admin Chat?
#7

This also works really great
pawn Код:
if(strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "/a", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[96];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/a)dmin [admin chat]");
                return 1;
            }
            new atext[60];
            if(PlayerInfo[playerid][pAdmin] == 1){ atext = "SAdmin(1)"; }
            if(PlayerInfo[playerid][pAdmin] == 2){ atext = "Junior Admin(2)"; }
            if(PlayerInfo[playerid][pAdmin] == 3){ atext = "General Admin(3)"; }
            if(PlayerInfo[playerid][pAdmin] == 4){ atext = "Senior Admin(4)"; }
            if(PlayerInfo[playerid][pAdmin] == 1337){ atext = "Elite Admin(1337)"; }
            if(PlayerInfo[playerid][pAdmin] == 99998) { atext = "Head Scripter(99998)"; }
            if(PlayerInfo[playerid][pAdmin] == 99999) { atext = "Server Owner(99999)"; }
            format(string, sizeof(string), "*%d %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                SendAdminMessage(COLOR_YELLOW, string);
            }
        }
        return 1;
Reply


Messages In This Thread
Admin Chat? - by jonnyboy - 12.04.2011, 13:05
Re: Admin Chat? - by AntiGen - 12.04.2011, 13:10
Re: Admin Chat? - by Seven_of_Nine - 12.04.2011, 13:17
Re: Admin Chat? - by jonnyboy - 12.04.2011, 13:21
Re: Admin Chat? - by alpha500delta - 12.04.2011, 13:51
Re: Admin Chat? - by jonnyboy - 12.04.2011, 14:53
Re: Admin Chat? - by blazee14 - 13.04.2011, 10:38

Forum Jump:


Users browsing this thread: 1 Guest(s)