Please help me with this tiny bit of admin script?
#2

pawn Код:
if(strcmp(cmd, "/say", true) == 0) // Publicly says an admin message. Exact same as RCON's 'say' but in a red color.
    {
      if (AccountInfo[playerid][AdminLevel] >= 3 || IsPlayerAdmin(playerid))
    {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new result[128];
            result = bigstrtok(cmdtext, idx);
            if(!strlen(result))
            {
                SendClientMessage(playerid, ORANGE, "USAGE: /say [message]");
                SendClientMessage(playerid, ORANGE, "FUNCTION: Will broadcast an admin message.");
                return 1;
            }
            new AdminName[MAX_PLAYER_NAME];
            GetPlayerName(playerid,AdminName,sizeof(AdminName));
            format(string, sizeof(string), "* Admin %s: %s", AdminName,result);
            SendClientMessageToAll(LIGHTRED, string);
            printf("%s", string);
        }
        else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
        return 1;
    }
Reply


Messages In This Thread
Please help me with this tiny bit of admin script? - by ThePS3Guy - 07.08.2009, 23:35
Re: Please help me with this tiny bit of admin script? - by coole210 - 08.08.2009, 00:32
Re: Please help me with this tiny bit of admin script? - by ThePS3Guy - 08.08.2009, 00:45

Forum Jump:


Users browsing this thread: 2 Guest(s)