14.09.2012, 16:18
First of all:
If you're using y_ini, you must use the 'INI_ParseFile' function. You can search for more information on it in the y_ini thread by ******.
pawn Код:
COMMAND:makeadmin(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
new id, lvl;
if(sscanf(params, "ui", id, lvl)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /makeadmin [PlayerID/PartOfName] [Level]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Invalid ID");
if(lvl > 5 || level < 0) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Administrator level must be between 0 and 5!");
PlayerInfo[id][Adminlevel] = lvl;
return 1;
}