Admin Chat
#5

I suggest you use zmcd but if you must use strcmp alone then...

pawn Код:
if(strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "/c", 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[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: (/c) [admin chat]");
                return 1;
            }
            format(string, sizeof(string), "*%d Admin %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if (PlayerInfo[i][pAdmin] >= 1)
                {
                    SendAdminMessage(i, COLOR_LIGHTGREEN, string);
                }
            }
                                 format(string,sizeof(string), "Server - AdminChat [%d] %s: %s",playerid, sendername, result);
        }
        return 1;
    }
Edit: Damn got ninja'd
Reply


Messages In This Thread
Admin Chat - by ]B4E[kengston - 05.01.2011, 23:22
Re: Admin Chat - by Kaylux - 05.01.2011, 23:24
AW: Admin Chat - by ]B4E[kengston - 05.01.2011, 23:26
Re: Admin Chat - by John_F - 05.01.2011, 23:31
Re: Admin Chat - by Kaylux - 05.01.2011, 23:32
AW: Admin Chat - by ]B4E[kengston - 05.01.2011, 23:35
Re: Admin Chat - by iggy1 - 06.01.2011, 06:44
Re: Admin Chat - by Joe Staff - 06.01.2011, 07:16

Forum Jump:


Users browsing this thread: 2 Guest(s)