/makeadmin
#10

Here's the code

pawn Код:
CMD:makeadmin(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 99999)
    {

        new
        iAdminValue,
        iTargetID;

        if(sscanf(params, "ui", iTargetID, iAdminValue)) {
            SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid] [level]");
            SendClientMessageEx(playerid, COLOR_GRAD1, "Server Moderator[1], Junior Admin[2], General Admin[3], Senior Admin[4], Head Admin[1337]");
            SendClientMessageEx(playerid, COLOR_GRAD1, "Server Manager[1338], Server Co-Owner[99998], Server Owner[99999]");
        }
        else if(IsPlayerConnected(iTargetID))
        {
            new
            szMessage[47 + (MAX_PLAYER_NAME * 2)];

            PlayerInfo[iTargetID][pAdmin] = iAdminValue;
            format(szMessage, sizeof(szMessage), "AdmCmd: %s has promoted %s to a level %d admin.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID), iAdminValue);
            ABroadCast(COLOR_LIGHTRED,szMessage, 2);
            format(szMessage, sizeof(szMessage), "You have been promoted to a level %d admin by %s.", iAdminValue, GetPlayerNameEx(playerid));
            SendClientMessageEx(iTargetID, COLOR_LIGHTBLUE, szMessage);
            format(szMessage, sizeof(szMessage), "You have promoted %s to a level %d admin.", GetPlayerNameEx(iTargetID),iAdminValue);
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);
        }
        else SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
    }
    else SendClientMessageEx(playerid, COLOR_GRAD1, "You are a fucker! You can't do this !");
    return 1;
}
+rep if i help
Reply


Messages In This Thread
/makeadmin - by ChristianIvann09 - 04.04.2014, 10:15
Re: /makeadmin - by Mriss - 04.04.2014, 10:18
Re: /makeadmin - by ChristianIvann09 - 04.04.2014, 10:28
Re: /makeadmin - by biker122 - 04.04.2014, 11:05
Re: /makeadmin - by Bingo - 04.04.2014, 11:14
Re: /makeadmin - by BigBrainAFK - 04.04.2014, 11:16
Re: /makeadmin - by ChandraLouis - 04.04.2014, 11:19
Re: /makeadmin - by biker122 - 04.04.2014, 11:20
Re: /makeadmin - by Bingo - 04.04.2014, 11:21
Re: /makeadmin - by ChuckyBabe - 04.04.2014, 11:41

Forum Jump:


Users browsing this thread: 2 Guest(s)