02.03.2012, 09:53
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; }