AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [solved]comparing two strings weird problem (https://forums.alliedmods.net/showthread.php?t=93029)

Owyn 05-23-2009 12:35

[solved]comparing two strings weird problem
 
PHP Code:

new szArray[33][33]


//code to write stuff into array
new buffer[15]
        
formatexbuffer14"%d"enc(text) );
        
szArray[id] = buffer;

//code to compare written stuff in array with user input from console

public compare(id)
{
    new 
cmd2[20]];
    
read_argv(1,cmd2,19);
    
        
log_amx("C_ENC: %s",cmd2)
        if ( 
equal(cmd2saydb[id]) )
            {
log_amx("EQUAL"); }
        else{
log_amx("servers ^"%s^" NOT EQUAL to clients ^"%s^"",saydb[id],cmd2);
    }
    
    return 
PLUGIN_HANDLED


both are char and same but... it says not equal, i'm little confused
Quote:

L 05/23/2009 - 20:27:13: [myplugin.amxx] servers "24" NOT EQUAL to clients "24"

Jon 05-23-2009 12:38

Re: comparing two strings
 
Try trim() or remove_quotes()

Owyn 05-23-2009 12:42

Re: comparing two strings
 
Quote:

Originally Posted by Jon (Post 833145)
Try trim() or remove_quotes()

did it for both, still says not equal

xPaw 05-23-2009 12:47

Re: comparing two strings weird problem
 
Not sure if would it can help...
PHP Code:

new yoursmth;
yoursmth str_to_numcmd2 ); 


Owyn 05-23-2009 12:47

Re: [solved]comparing two strings weird problem
 
yes, i thougt about strn_to_num too, but then i saw that i've did big thing wrong before)) *solved


All times are GMT -4. The time now is 01:36.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.