25.11.2012, 15:43
pawn Код:
CMD:setlevel(playerid, params[])
{
if(PInfo[playerid][Level] < 5) return SendClientMessage(playerid,0xFF0000AA,"ERROR: You are not allowed to use this command!");
new
id,
level;
if(sscanf(params, "ui", id, level))
return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /setlevel <id> <level>");
if(!IsPlayerConnected(id))
return SendClientMessage(playerid, 0xFF0000FF, "That player is not connected!");
new
file[64],
PlayerName[24];
GetPlayerName(id, PlayerName, sizeof PlayerName);
format(file, sizeof file, "Admin/%s.ini", PlayerName);
if(!fexist(file))
return SendClientMessage(playerid, 0xFF0000FF, "That player is not registered");
INI_Open(file);
INI_WriteInt("Level", level);
INI_Save();
INI_Close();
PInfo[id][Level] = level;
SendClientMessage(playerid, blue, "You have changed the selected user's admin level");
SendClientMessage(id, blue, "Your admin level has been changed");
return 1;
}
"You have been promoted to level 2"
And i want a max admin level of 7, can someone help me with that?