 |
|
Junior Member
|

04-10-2009
, 17:16
Re: fgets, format (general messup)
|
#4
|
Quote:
Originally Posted by fysiks
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) 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)
|
fgets stores data into the second parameter and returns 0 on error
EDIT: OR DOES IT :p
EDIT2: NO IT DOESNT >.<
Last edited by marky_uk; 04-10-2009 at 17:18.
|
|
|
|