Whats Wrong With This?
#10

pawn Код:
CMD:setlevel(playerid, params[])
{
    new string[128], id, level, Name[MAX_PLAYER_NAME], AdminName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, AdminName, sizeof(AdminName));
    GetPlayerName(id, Name, sizeof(Name));
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Are Not An Administrator!");
    if(sscanf(params, "ui", id, level)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /setlevel <ID/Part Of Name> <Level>");
    if(!PlayerInfo[id][PLAYER_LOGGED]) return SendClientMessage(playerid, COLOR_RED, "That player isn't logged in!");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "That player isn't online!");
    if(level > 5 || level < 0) return SendClientMessage(playerid, COLOR_RED, "The level must be between 0 and 5.");
    else
    {
        PlayerInfo[id][PLAYER_LEVEL] = level;
        format(string, sizeof(string), "You Have Been Set To %d Administrator By %s!", level, AdminName);
        SendClientMessage(id, COLOR_YELLOW, string);
        format(string, sizeof(string), "%s Has Successsfully Been Set To Level %d Administrator!", Name, level);
        SendClientMessage(playerid, COLOR_YELLOW, string);
    }
    return 1;
}
Whoops, I made a little bit of a typo. Fixed.
Reply


Messages In This Thread
Whats Wrong With This? - by Littlehelper - 16.02.2012, 11:32
Re: Whats Wrong With This? - by ReneG - 16.02.2012, 11:37
Re: Whats Wrong With This? - by Littlehelper - 16.02.2012, 11:40
Re: Whats Wrong With This? - by Mark™ - 16.02.2012, 11:42
Re: Whats Wrong With This? - by Konstantinos - 16.02.2012, 11:42
Re: Whats Wrong With This? - by Littlehelper - 16.02.2012, 11:46
Re: Whats Wrong With This? - by Mark™ - 16.02.2012, 11:50
Re: Whats Wrong With This? - by Konstantinos - 16.02.2012, 11:52
Re: Whats Wrong With This? - by Littlehelper - 16.02.2012, 11:52
Re: Whats Wrong With This? - by ReneG - 16.02.2012, 12:00

Forum Jump:


Users browsing this thread: 1 Guest(s)