Raised This Month: $ Target: $400
 0% 

equal Problem?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 04-30-2011 , 08:27   equal Problem?
Reply With Quote #1

Code:
            new send[256];             setc(send, 4, 0xff)             copy(send[4], 255, "challenge")             new szCommand[ 32 ];             strtok( g_HLTV_recv, szCommand, charsmax( szCommand ), g_HLTV_recv, charsmax( g_HLTV_recv ), ' ', 1 );             server_print("[HLTV] Command: %s (%d) - %s (%d)",szCommand,strlen(szCommand),send,strlen(send));             if (equali(szCommand,send))             {                 new temp[32];                 gettok(temp,g_HLTV_recv,2,32);                 replace(temp, 31, "^n", "")                 server_print("%s %d",temp,str_to_num(temp));                 g_HLTV_challenge=str_to_num(temp);                 g_HLTV_Busy=0;             }

Well in this
i am getting a result:
Quote:
[HLTV] ************************************challenge rcon 3031699845

[HLTV] Command: ************************************challenge (13) - ************************************challenge (13)
But it doesn't pass the "equal" check why?
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-30-2011 , 08:47   Re: equal Problem?
Reply With Quote #2

May be
Code:
 if (equali(szCommand[4],send[4]))
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 04-30-2011 , 09:02   Re: equal Problem?
Reply With Quote #3

Code:
                new temp[32];                 gettok(temp,g_HLTV_recv,2,32);                 replace(temp, 31, "^n", "")                 server_print("%s %d",temp,str_to_num(temp));
Quote:
[HLTV] Command: ************************************challenge (13) - ************************************challenge (13)
3000969614 2147483647
With str_to_num 2 different values? lol ?
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-30-2011 , 09:10   Re: equal Problem?
Reply With Quote #4

Try
PHP Code:
if (equali(szCommand,send,strlen(send))) 
__________________

SonicSonedit is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 04-30-2011 , 09:43   Re: equal Problem?
Reply With Quote #5

My if passed, there is other problem :/
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-30-2011 , 09:56   Re: equal Problem?
Reply With Quote #6

1. Have you tried what i asked you to try ?
2. Have you tried equal instead of equali ?
3. Try this to see where equal fails :
PHP Code:
Equal(const szA[], const szB[], iNum 0)
{
    static 
a0

    
if( iNum )
    {
        while( (
szA[i]) && == szB[i] && --iNum)
        {
            ++
i
        
}
        
server_print("Strings <%s> and <%s> are not equal, Chars #%d are different <%c> <%c>"szAszBiaszB[i])
        return !
iNum
    
}

    
szA[i]
    do
    {
        if( 
!= szB[i])
        {
            
server_print("Strings <%s> and <%s> are not equal, Chars #%d are different <%c> <%c>"szAszBiaszB[i])
            return 
0
        
}
    }
    while( (
szA[++i]) )

    return !
szB[i]

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 04-30-2011 at 09:59.
ConnorMcLeod is offline
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 04:26.


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