Raised This Month: $ Target: $400
 0% 

Solved Symbol is never used


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-17-2019 , 13:16   Re: "Symbol is never used"
Reply With Quote #7

Quote:
Originally Posted by Natsheh View Post
That what equal function does?

I don't see the reason of you using this function since its totally useless.
You can't call something useless if you don't understand what it does.

If you're interested what it does, it compares each character of both strings to see if string1 contains all the characters from string2, normal contain/i compares strings as whole, so if we have abcd and adcb it's going to return false, even though they both are the same, except for the order.

Normal contain:
PHP Code:
#include < amxmodx >

new const g_szString1[ ] = "abcd";
new const 
g_szString2[ ] = "adcb";

public 
plugin_init( )
{
    if( 
containg_szString1g_szString2 ) != -)
    {
        
log_to_file"Contain.txt""True" );
    }

    else
    {
        
log_to_file"Contain.txt""False" );
    }

Log:
Code:
L 07/17/2019 - 19:17:05: False
New contain:
PHP Code:
#include < amxmodx >

new g_szString1[ ] = "abcd";
new 
g_szString2[ ] = "adcb";

public 
plugin_init( )
{
    if( 
contain_allg_szString1charsmaxg_szString1 ), g_szString2charsmaxg_szString2 ) ) )
    {
        
log_to_file"Contain.txt""True" );
    }

    else
    {
        
log_to_file"Contain.txt""False" );
    }
}

public 
contain_allszStringSrc[ ], iSize1szStringCompare[ ], iSize2 )
{
    new 
bool:bEqual;

    for( new 
iiSize1i++ )
    {
        for( new 
jiSize2j++ )
        {
            if( 
szStringSrc] == szStringCompare] )
            {
                
bEqual true;
                break;
            }
            
            else
            {
                
bEqual false;
            }
        }
        
        if( ! 
bEqual )
        break;
    }
    
    return 
bEqual;

Log:
Code:
L 07/17/2019 - 19:20:00: True
__________________

Last edited by edon1337; 07-17-2019 at 13:21.
edon1337 is offline
 



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 17:24.


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