Setlevel
#1

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;
}
I got that command, i want it to say to WHAT admin level you changed to so like

"You have been promoted to level 2"

And i want a max admin level of 7, can someone help me with that?
Reply


Messages In This Thread
Setlevel - by Biess - 25.11.2012, 15:43
Re: Setlevel - by Hoss - 25.11.2012, 15:45
Re: Setlevel - by Biess - 25.11.2012, 17:19

Forum Jump:


Users browsing this thread: 1 Guest(s)