Problem with setting cmd's for admin
#1

After i do this on my player it don't set me as Level 1 admin ,could anyone help me?

Код:
CMD:setlevel(playerid, params[])
{
    if(PlayerInfo[playerid][Adminlevel] == 1 || IsPlayerAdmin(playerid))
    {
    new id, lvl;
    if(sscanf(params, "ui", id, lvl)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_DGREY#"/setlevel / "#COL_SGREY#"[PlayerID/PartOfName] [Level]");
    else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid ID");
    else if(lvl > 1) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE#"[ADMIN]"#COL_LRED#" Administrator level cannot be higher then 1!");
    else
	{
	new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Kills",PlayerInfo[playerid][Kills]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][Deaths]);
    INI_WriteInt(File,"Adminlevel",PlayerInfo[playerid][Adminlevel]);
    INI_Close(File);
    PlayerInfo[id][Adminlevel] = lvl;
    }
    }
    return 1;
}
Reply


Messages In This Thread
Problem with setting cmd's for admin - by niere - 02.03.2012, 09:53
Re: Problem with setting cmd's for admin - by milanosie - 02.03.2012, 09:59
Re: Problem with setting cmd's for admin - by niere - 02.03.2012, 10:05
Re: Problem with setting cmd's for admin - by milanosie - 02.03.2012, 10:08
Re: Problem with setting cmd's for admin - by niere - 02.03.2012, 10:14
Re: Problem with setting cmd's for admin - by milanosie - 02.03.2012, 10:17
Re: Problem with setting cmd's for admin - by niere - 02.03.2012, 10:20
Re: Problem with setting cmd's for admin - by FuTuяe - 02.03.2012, 11:21
Re: Problem with setting cmd's for admin - by niere - 02.03.2012, 11:35
Re: Problem with setting cmd's for admin - by Gamer_Z - 02.03.2012, 11:45

Forum Jump:


Users browsing this thread: 1 Guest(s)