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