View Single Post
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-17-2010 , 09:40   Re: String lengh issue
Reply With Quote #13

You should pass the destination string to charsmax in string functions, not the source string. Also, you can remove the return PLUGIN_HANDLED in the if statement since the one immediately follows it outside of the if-else statement.
PHP Code:
public cmdGetArgs(id)
{
    new 
args32 ];
    
    
read_argsargs charsmaxargs ) );
    
remove_quotesargs );

    if( 
strlenargs ) > 31 )
    {
        
client_printid print_chat "You cant do that" );
        
client_cmdid "messagemode SetArgs" );
    }
    else
    {
        
copyPlyrArgsid ] , charsmaxPlyrArgs[] ) , args );
    }
    
    return 
PLUGIN_HANDLED;

__________________
Bugsy is offline