/makeadmin not working propely. Waird bug.
#6

Try it! I hope it works.
pawn Код:
CMD:makeadmin( playerid, params[ ] )
{
    new id, AdminLevel2;
    if( PlayerInfo[ playerid ][ AdminLevel ] < 5 || !IsPlayerAdmin( playerid ) ) return NotAdmin( playerid );
    if( sscanf( params, "ri", id, AdminLevel2 ) ) return SendClientMessage( playerid, COLOR_DARKGOLD, "USAGE: /makeadmin [PlayerId/PartOfName] [Admin Level]" );
    if( ( AdminLevel2 >= 1 && AdminLevel2 <= 5 ) || AdminLevel2 == 0 )
    {
        new string[128]; new Name[MAX_PLAYER_NAME]; new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Name, sizeof(Name));
        GetPlayerName(id, PlayerName, sizeof(PlayerName));
        format(string, sizeof(string), "%s Has Given You %d Admin Level.", Name, AdminLevel2);
        SendClientMessage(id, COLOR_LIGHTBLUE, string);
        format(string, sizeof(string), "You Gave %d Admin Level To %s.", AdminLevel2, PlayerName);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        PlayerInfo[id][AdminLevel] = AdminLevel2;
    }
    else SendClientMessage(playerid, COLOR_DARKGOLD, "Avaliable Levels: 1, 2, 3, 4 and 5.");
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)