Bugged Id's
#9

Try this code;
pawn Код:
CMD:makeadmin( playerid, params[] )
{
    new
        iAdminValue,
        iTargetID,
        szMessage[ 128 ]
    ;

    if( sscanf( params, "ui", iTargetID, iAdminValue ) )
        return SendClientMessage( playerid, COLOR_WHITE, "USAGE: /makeadmin [playerid] [level]" );

    if( PlayerInfo[ playerid ][ pAdmin ] != 1338 )
        return SendClientMessage( playerid, COLOR_GRAD1, "You are not authorized to use that command!" );

    if( !IsPlayerConnected( iTargetID ) )
        return SendClientMessage( playerid, COLOR_GRAD2, "Invalid player specified." );
   
    if( PlayerInfo[ iTargetID ][ pHelper ] >= 1 )
        return SendClientMessage( playerid, COLOR_GRAD1, "You cannot make community advisors admins!" );

    PlayerInfo[ iTargetID ][ pAdmin ] = iAdminValue;
   
    format( szMessage, 128, "AdmCmd: %s has promoted %s to a level %d admin.", GetPlayerNameEx( playerid ), GetPlayerNameEx( iTargetID ), iAdminValue );
    ABroadCast( COLOR_LIGHTRED, szMessage, 2 );

    format( szMessage, 128, "You have been promoted to a level %d admin by %s.", iAdminValue, GetPlayerNameEx( playerid ) );
    SendClientMessage( iTargetID, COLOR_LIGHTBLUE, szMessage );

    format( szMessage, 128, "You have promoted %s to a level %d admin.", GetPlayerNameEx( iTargetID ), iAdminValue );
    SendClientMessage(playerid, COLOR_LIGHTBLUE, szMessage );

    return 1;
}
Reply


Messages In This Thread
Bugged Id's - by Infinity90 - 21.02.2012, 14:44
Re: Bugged Id's - by Babul - 21.02.2012, 14:47
Re: Bugged Id's - by Infinity90 - 21.02.2012, 14:48
Re: Bugged Id's - by Toreno - 21.02.2012, 15:03
Re: Bugged Id's - by Infinity90 - 21.02.2012, 15:06
Re: Bugged Id's - by Toreno - 21.02.2012, 15:09
Re: Bugged Id's - by emokidx - 21.02.2012, 15:09
Re: Bugged Id's - by Infinity90 - 21.02.2012, 15:11
Re: Bugged Id's - by Toreno - 21.02.2012, 15:21

Forum Jump:


Users browsing this thread: 1 Guest(s)