WeaponEnt contains a string. That string happens to be the text that makes up a function. This "function" will never get executed because it is just a string of characters.
Basically:
WeaponEnt[0] = "f"
Also, I don't think fgets returns a value. Here is what I use to take in two parameters (mapname and number):
PHP Code:
new maproundsfile[64]
get_configsdir(maproundsfile, sizeof(maproundsfile) - 1)
add(maproundsfile, sizeof(maproundsfile) - 1, "/map_rounds.ini")
if( !file_exists(maproundsfile) ) return
new curmap[64]
get_mapname(curmap, sizeof(curmap) - 1)
new f = fopen(maproundsfile, "rt")
new data[128], map[64], rounds[16]
while( !feof(f) )
{
fgets(f, data, sizeof(data) - 1)
// I think trim(data) needs to go here since fgets includes newline and carriage return characters.
if( !data[0] || data[0] == ';'
|| data[0] == '/' && data[1] == '/' ) continue;
parse(data,
map, sizeof(map) - 1,
rounds, sizeof(rounds) - 1
)
if( !strcmp(curmap, map) )
{
set_pcvar_num(cvar_mp_maxrounds, str_to_num(rounds))
mapfound = true
break
}
}
fclose(f)
__________________