Makeadmin
#1

So, i've been scripting my /makeadmin cmds, and other cmds, but i know i am missing a line or two.
Currently everything works, so if you do /makeadmin Dobby 8, his admin level will be set to 8. but once i do /makeadmin, without anything behind, it sets dobby's adminlevel to 0.

CMD:
pawn Код:
CMD:makeadmin(playerid, params[])
{
            new admin, playerb;
            if(PlayerInfo[playerid][pAdmin] < 8) return SendClientMessage(playerid, COLOR_REDD, "[ERROR] You do not have the right's to use this command!");
            if(sscanf(params, "ui", playerb, admin)) SendClientMessage(playerid, COLOR_LGREEN, "Usage: /makeadmin [playerid/partname] [level]");
            {
              PlayerInfo[playerb][pAdmin] = admin;
              SendClientMessage(playerb, -1, "Your admin level has been changed!"); // i know these 2 lines look's gay, but i cba to change them xD
              SendClientMessage(playerid, -1, "You changed their admin level!");
              return 1;
            }
}
Reply
#2

Did you do through the RCON
Reply
#3

nope, and i see the error already, i forgot to place a return @
pawn Код:
if(sscanf(params, "ui", playerb, admin)) SendClientMessage(playerid, COLOR_LGREEN, "Usage: /makeadmin [playerid/partname] [level]");
It should be:
pawn Код:
if(sscanf(params, "ui", playerb, admin)) return SendClientMessage(playerid, COLOR_LGREEN, "Usage: /makeadmin [playerid/partname] [level]");
Thanks anyways :P
Reply
#4

if(sscanf(params, "ui", playerb, admin)) return SendClientMessage(playerid, COLOR_LGREEN, "Usage: /makeadmin [playerid/partname] [level]");
Reply
#5

pawn Код:
CMD:makeadmin(playerid, params[])
{
    new admin, playerb;
    if(PlayerInfo[playerid][pAdmin] < 8) return SendClientMessage(playerid, COLOR_REDD, "[ERROR] You do not have the right's to use this command!");
    if(sscanf(params, "ui", playerb, admin)) return SendClientMessage(playerid, COLOR_LGREEN, "Usage: /makeadmin [playerid/partname] [level]");
    SendClientMessage(playerb, -1, "Your admin level has been changed!");
    SendClientMessage(playerid, -1, "You changed their admin level!");
    PlayerInfo[playerb][pAdmin] = admin;
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)