Raised This Month: $ Target: $400
 0% 

[solved]comparing two strings weird problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Owyn
Veteran Member
Join Date: Nov 2007
Old 05-23-2009 , 12:35   [solved]comparing two strings weird problem
Reply With Quote #1

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"
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.

Last edited by Owyn; 05-23-2009 at 12:38.
Owyn is offline
Send a message via ICQ to Owyn
Jon
Veteran Member
Join Date: Dec 2007
Old 05-23-2009 , 12:38   Re: comparing two strings
Reply With Quote #2

Try trim() or remove_quotes()
Jon is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 05-23-2009 , 12:42   Re: comparing two strings
Reply With Quote #3

Quote:
Originally Posted by Jon View Post
Try trim() or remove_quotes()
did it for both, still says not equal
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-23-2009 , 12:47   Re: comparing two strings weird problem
Reply With Quote #4

Not sure if would it can help...
PHP Code:
new yoursmth;
yoursmth str_to_numcmd2 ); 
__________________
xPaw is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 05-23-2009 , 12:47   Re: [solved]comparing two strings weird problem
Reply With Quote #5

yes, i thougt about strn_to_num too, but then i saw that i've did big thing wrong before)) *solved
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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