Value problem..?
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
ZCMD cannot get space in the command's name. Basically, it's: cmd_%s (%s = command's name).
pawn Код:
CMD:play( playerid, params[ ] )
{
    if( isnull( params ) ) return SendClientMessage( playerid, -1, "Usage: /play <1-N>" );
    if( !IsNumeric( params ) ) return SendClientMessage( playerid, -1, "You need to enter a number" );
   
    new
        song = strval( params )
    ;
    if( song < 0 || song > N ) return SendClientMessage( playerid, -1, "between 1 and N" ); // CHANGE N
    switch( song )
    {
        case 1: // play the song 1
        case 2: // play the song 2
        // ..
        // case N: // play the song N
    }
    return 1;
}
pawn Код:
stock IsNumeric( const string[ ] )
{
    for( new i = 0, j = strlen( string ); i < j; i++ ) if( string[ i ] > '9' || string[ i ] < '0' ) return 0;
    return 1;
}
Thanks, again...
Reply


Messages In This Thread
Value problem..? - by CesarLT - 25.09.2013, 17:45
Re: Value problem..? - by Konstantinos - 25.09.2013, 17:57
Re: Value problem..? - by CesarLT - 25.09.2013, 18:15
Re: Value problem..? - by JimmyCh - 25.09.2013, 18:26

Forum Jump:


Users browsing this thread: 1 Guest(s)