Invalid player ID with sscanf
#4

pawn Код:
CMD:setadmin ( playerid , params [] )
{
    if ( PlayerInfo [ playerid ][ AdminLevel ] <= 5) return MESSAGE(cred, errorna);
    new ID , LvL , pName [ MAX_PLAYER_NAME ] ;
    GetPlayerName ( ID , pName , MAX_PLAYER_NAME ) ;
    if ( !IsPlayerConnected ( ID ) ) return MESSAGE(cred, invalid);
    if ( sscanf ( params "ud" , ID , LvL ) ) return MESSAGE ( cred , "USAGE:{FFFFFF} /setadmin [name/id] [level]" ) ;
    else
    {
    PlayerInfo[id][AdminLevel] = 6;
    new Str [ 128 ] ;
    format ( Str , 128 , "Admin level set for %s" , ID ) ;
    MESSAGE ( cyellow , Str ) ;
    format ( Str , 128 , "Admin level (%d) set by admin" , LvL ) ;
    SendClientMessage ( ID , cwhite , Str);
   
    }
    return 1;
}
Not Tested.
Reply


Messages In This Thread
Invalid player ID with sscanf - by DBan - 26.03.2012, 11:47
Re: Invalid player ID with sscanf - by Reklez - 26.03.2012, 11:49
Re: Invalid player ID with sscanf - by DBan - 26.03.2012, 12:09
Re: Invalid player ID with sscanf - by Ronaldo_raul™ - 26.03.2012, 13:49
Re: Invalid player ID with sscanf - by cristip - 25.05.2013, 13:51
Re: Invalid player ID with sscanf - by Littlehelper - 25.05.2013, 13:53

Forum Jump:


Users browsing this thread: 1 Guest(s)