Help Convert cmd
#2

This can be more easy using sscanf and ZCMD.



pawn Код:
CMD:givecookie ( playerid , params [] )
{
    if ( !PlayerInfo [ playerid ] [ pAdmin ] < 4 ) return SendClientMessage ( playerind , COLOR_GRAD1 , "Your are not authorizes to use that command!" ) ;
    new ID , Str [ 128 ] ;
    if ( !IsPlayerConnected ( ID ) ) return SendClientMessage ( playerid , -1 , "Invalid Player ID" ) ;
    if ( sscanf ( params , "us[128]" , ID , Str ) ) return SendClientMessage ( playerid , -1 , "Usage : /givecookie [ID] [Reason]" ) ;
    else
    {
    new pName [ MAX_PLAYER_NAME ] , vName [ MAX_PLAYER_NAME ] , string [ 128 ] ;
    GetPlayerName ( playerid , pName , MAX_PLAYER_NAME ) ;
    GetPlayerName ( ID , vName , MAX_PLAYER_NAME ) ;
    PlayerInfo [ giveplayerid ][ pCookies ] += 1;
    format ( string , 128 , "AdmCmd: %s has been given a cookie by %s, reason: %s" , pName , vName , Str );
    SendClientMessageToAll ( -1 , string ) ;
    }
    return 1;
}
Reply


Messages In This Thread
Help Convert cmd - by Adrian84 - 22.03.2012, 16:49
Re: Help Convert cmd - by Ronaldo_raul™ - 23.03.2012, 07:35

Forum Jump:


Users browsing this thread: 1 Guest(s)