Raised This Month: $51 Target: $400
 12% 

equali() problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ceribik
SourceMod Donor
Join Date: Dec 2007
Old 08-13-2008 , 08:16   equali() problem
Reply With Quote #1

Hello. I've got the following code below; which in summary, reads a file and sees if the current map is listed in the file. For an unknown reason, the comparation of the two strings (mapname and data) isn't working and makes function output false

Code:
new mapname[33];

...

public plugin_init()
{
      get_mapname(mapname, 31);
}

...

stock checkLevelMap()
{
    new listFilename[256];
    
    new confFolder[32];
    get_configsdir(confFolder, 31);
    format(listFilename, 255, "%s/levelmaps.ini", confFolder);
    
    if( file_exists(listFilename) )
    {
        new file = fopen(listFilename, "rt");
        
        new data[64]; 
        while( !feof(file) )
        {
            fgets(file, data, 63); 
            
            server_cmd("echo data == %s", data);
            
            if( equali(mapname, data) )
            {
                fclose(file);
                
                return true;
            }
            
        }
        
        fclose(file);
        
        return false;
    }
    else
    {
        log_amx("[SurfLife] Could not load levelmaps.ini");
    }

    
    return false;
}
Any help would be appreciated
ceribik 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 14:59.


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