Thread: [Solved] contain & containi
View Single Post
Author Message
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 12-19-2017 , 12:18   contain & containi
Reply With Quote #1

Can somebody give me more details about containi? I cannot understand it properly.
The code isn't helping me to much(craziness)
PHP Code:
static cell AMX_NATIVE_CALL contain(AMX *amxcell *params/* 2 param */
{
    
register cell *get_amxaddr(amxparams[2]);
    
register cell *get_amxaddr(amxparams[1]);
    
register cell *b;
    
cellstr b;
    
cellsubstr a;
    
    while (*
c)
    {
        if (*
== *a)
        {
            
c++;
            if (!*++
a)
                return 
str;
        } else {
            
= ++b;
            
substr;
        }
    }
    
    return -
1;
}

static 
cell AMX_NATIVE_CALL containi(AMX *amxcell *params/* 2 param */
{
    
register cell *get_amxaddr(amxparams[2]);
    
register cell *get_amxaddr(amxparams[1]);
    
register cell *b;
    
cellstr b;
    
cellsubstr a;
    
    while (*
c)
    {
        if (
tolower(*c) == tolower(*a))
        {
            
c++;
            if (!*++
a)
                return 
str;
        } else {
            
= ++b;
            
substr;
        }
    }
    
    return -
1;

__________________

Last edited by Relaxing; 12-20-2017 at 00:53.
Relaxing is offline