HELP WITH /setadmin "URGENTLY" FAST!
#4

Quote:
Originally Posted by Toxik
Посмотреть сообщение
when i try ingame to /setadmin (someones id) (level )
whatever level i put there all time give them lvl 1
Change

// new Admin;

and put

new level;

then replace all "Admin" for set "level", exept in this part: PlayerInfo[ID][Admin]


you will have this:

pawn Код:
CMD:setadmin(playerid,params[])
{
    new ID;
    new level;
    new string[128];
    if(PlayerInfo[playerid][Admin] >= 5)
    {
        if(sscanf(params,"ui", ID, level)) return SendClientMessage(playerid,-1,"{FF0000}USAGE: {15FF00}/SetAdmin [ID] [Level]");
        if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,-1,"Player is not connected");
        PlayerInfo[ID][Admin] = level;
        format(string, sizeof(string), "{FF0000}[INFO]: {15FF00}You gave to {FF0000}%s {15FF00}Admin Level {0066CC}: %i", GetPName(ID), level);
        SendClientMessage(playerid, -1, string);
        format(string, sizeof(string), "{FF0000}[INFO]: {15FF00}Admin {FF0000}%s {15FF00}has setted your Admin Level to{0066CC}: %i", GetName(playerid), level);
        SendClientMessage(ID, -1, string);
    }
    else
    {
        SendClientMessage(playerid, -1, "You need to be Admin Level 5 !");
    }
    return 1;
}

stock GetPName(playerid)
{
    new Name[24];
    GetPlayerName(playerid, Name,24);
    return Name;
}
The problem was, you have not definied nothing because you have // before the new Admin;
Also, you Have PlayerInfo[playerid][Admin], if you are using Admin you should not declare any variable with same name.
Reply


Messages In This Thread
HELP WITH /setadmin "URGENTLY" FAST! - by Toxik - 05.11.2014, 06:25
Re: HELP WITH /setadmin "URGENTLY" FAST! - by Mitchelll - 05.11.2014, 06:31
Re: HELP WITH /setadmin "URGENTLY" FAST! - by Toxik - 05.11.2014, 06:33
Respuesta: Re: HELP WITH /setadmin "URGENTLY" FAST! - by Spreadhaz - 05.11.2014, 06:49
Re: HELP WITH /setadmin "URGENTLY" FAST! - by Mitchelll - 05.11.2014, 06:49
Re: HELP WITH /setadmin "URGENTLY" FAST! - by Toxik - 05.11.2014, 06:56

Forum Jump:


Users browsing this thread: 1 Guest(s)