10-06-2011, 21:23
(10-06-2011, 21:13)Nukem Wrote: EDIT: look @ bottom of post
(10-06-2011, 21:01)Justin Wrote: ...
How about the gametypes then? gametypes are also in sv_maprotation.
Well, that code wasn't intended for that but I would just use @iAegle 's code then.
i'm bored so I coded this though (no idea what-so-ever if it works)
Code://gametype tdm map mp_cosmodrome map mp_nuked
strings = StrTok(GetDvar("sv_maprotation"), "gametype " + GetDvar("g_gametype"));
for(a = 0; a < strings.size; a++)
new_mapstring += strings[a];
// map mp_cosmodrome map mp_nuked
maps = StrTok(new_mapstring, " map ");
//not sure if the space before the first 'map' (" map") is counted in the array, so I just start with array[1]
for( i = 1; i < maps.size; i++ )
{
//etc...
}
lol you can really just ignore the code now.
The above code that @iAegle posted will probably not work as a string can have "gametype tdm map mp_lol" and it would return true.
if(GetSubStr(maps[i], 0, 3) == "mp_")
//code...
strings = StrTok(GetDvar("sv_maprotation"), "gametype " + GetDvar("g_gametype"));
Here it will fail already.
sv_maprotation "gametype dm map mp_map1 gametype sd map mp_map2"
What if different gametype in sv_maprotation then g_gametype? xD