Quote:
Originally Posted by fysiks
You could parse the text
|
PHP Code:
public CmdGetData( iClient )
{
new szArg[ 32 ];
read_args( szArg, 32 );
if( !strlen( szArg ) )
{
return PLUGIN_HANDLED;
}
remove_quotes( szArg );
new szR[ 4 ], szG[ 4 ], szB[ 4 ];
parse( szArg, szR, 3, szG, 3, szB, 3 );
new iR, iG, iB;
iR = str_to_num( szR ), iG = str_to_num( szG ), iB = str_to_num( szB );
console_print( iClient, "%i %i %i", iR, iG, iB );
return PLUGIN_HANDLED;
}
You should also clamp the values.