Help me about this thing :(
#1

I want if i give a player an admin level 0 it will say

"You have been removed from admin team by %s, the name of admin who gives the rank"

Код:
CMD:makeadmin(playerid, params[])
{
    if(CheckGMX(playerid)) return 1;
    if(PlayerInfo[playerid][pAdmin] >= 5)
    {
        new
            iAdminValue,
            iTargetID;

        if(sscanf(params, "ui", iTargetID, iAdminValue))
        {
            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid/partofname] [level]");
        }
        else if(IsPlayerConnected(iTargetID))
        {
            if(AdminDuty[iTargetID] != 0)
            {
                SendClientMessage(playerid, COLOR_WHITE, "That admin is currently on-duty. They must go off-duty in order for you to set their admin level.");
                return 1;
            }
            new szMessage[47 + (MAX_PLAYER_NAME * 2)];

            if(PlayerInfo[playerid][pAdmin] < 6 && iAdminValue == 6)
            {
                SendClientMessage(playerid, COLOR_WHITE, "You can't set player admin level to 6. Only Server Owner can make players level 6 Admin");
                return 1;
            }
            if(PlayerInfo[playerid][pAdmin] < 6 && iAdminValue == 5)
            {
                SendClientMessage(playerid, COLOR_WHITE, "You can't set player admin level to 5. Only Server Owner can make players level 5 Admin");
                return 1;
            }
            new pinoymess[128];
            format(szMessage, sizeof(szMessage), "AdmCmd: %s has set %s Admin Level to %d", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID), iAdminValue);
            ABroadCast(COLOR_LIGHTRED,szMessage,1);
            PlayerInfo[iTargetID][pAdmin] = iAdminValue;
            format(szMessage, sizeof(szMessage), "You have been set to Level %d Admin by %s.", iAdminValue, GetPlayerNameEx(playerid));
            format(pinoymess, sizeof(pinoymess), "Congratulations!Admin %s has been made you Level %d Admin use /ah for admin helps.", GetPlayerNameEx(playerid), iAdminValue);
            SendClientMessage(iTargetID, COLOR_WHITE, pinoymess);

            if(PlayerInfo[iTargetID][pHelper] >= 1) {
                PlayerInfo[iTargetID][pHelper] = 0;
                PlayerInfo[iTargetID][pAcceptReport] = 0;
            }

            if(iAdminValue == 0)
            {
                format(PlayerInfo[iTargetID][pAdminName], MAX_PLAYER_NAME, "0");
            }
        }
        else SendClientMessage(playerid, COLOR_GRAD2, "Invalid player specified.");
    }
    else SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)