Admin ranks - Switch
#9

Quote:
Originally Posted by ConnorW
Посмотреть сообщение
LOL are you kidding me?
EDIT:
Basically his /makeadmin code is wrong, this is how it should work
pawn Код:
CMD:makeadmin(playerid, params[])
{
    new id, AdminLevel;

    if(PlayerInfo[playerid][pAdmin] >= 3 || IsPlayerAdmin(playerid))
    {
        if(sscanf(params, "ui", id, AdminLevel))
            return SendClientMessage(playerid, -1, "USAGE: /makeadmin [ID] [LEVEL 1-4]");

        if(AdminLevel < 1 || AdminLevel > 4)
            return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid Admin level");

        if(!IsPlayerConnected(id))
            return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected!");
        PlayerInfo[id][pAdmin] = AdminLevel;
        SendClientMessageEx(playerid, COLOR_LAWNGREEN, "You've just been made: %s admin level: %i", ReturnName(id), GetAdminRankName(id));
        SendClientMessageEx(id, COLOR_LAWNGREEN, "You've just been made admin level: %i by %s", GetAdminRankName(id), ReturnName(playerid));
    }
    else return SendClientMessage(playerid, COLOR_RED, "ERROR: You are not an Admin!");

    return 1;
}
No I'm not kidding you, the output of the SCM is wrong. It won't show the admin rank because you're formatting an INTEGER instead of a string.

Your code:

PHP код:
        SendClientMessageEx(playeridCOLOR_LAWNGREEN"You've just been made: %s admin level: %i"ReturnName(id), GetAdminRankName(id));
        
SendClientMessageEx(idCOLOR_LAWNGREEN"You've just been made admin level: %i by %s"GetAdminRankName(id), ReturnName(id)); 
Reply


Messages In This Thread
Admin ranks - Switch - by Mo123 - 28.10.2018, 22:18
Re: Admin ranks - Switch - by RogueDrifter - 28.10.2018, 22:24
Re: Admin ranks - Switch - by TheToretto - 28.10.2018, 22:25
Re: Admin ranks - Switch - by Mo123 - 28.10.2018, 22:52
Re: Admin ranks - Switch - by TheToretto - 28.10.2018, 22:56
Re: Admin ranks - Switch - by d3Pedro - 29.10.2018, 04:07
Re: Admin ranks - Switch - by TheToretto - 29.10.2018, 06:45
Re: Admin ranks - Switch - by d3Pedro - 29.10.2018, 07:40
Re: Admin ranks - Switch - by TheToretto - 29.10.2018, 07:46

Forum Jump:


Users browsing this thread: 7 Guest(s)