View Single Post
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 07-07-2018 , 10:44   Re: CSGO in game map vote | EndMatchMapGroupVoteOptions
Reply With Quote #8

Another way to grab the maplist (keyvalues)

PHP Code:

void PrecacheMaps
()
{    
    
KeyValues kv = new KeyValues("GameModes_Server.txt");

    if(
kv.ImportFromFile("gamemodes_server.txt"))
    {    
        if(
kv.JumpToKey("mapgroups"))
        {
            if(
kv.GotoFirstSubKey(false))
            {
                if(
kv.JumpToKey("maps"))
                {
                    if(
kv.GotoFirstSubKey(false))
                    {
                        do 
                        {
                            
char Buffer[33];
                            
kv.GetSectionName(Buffersizeof(Buffer));
                            
                            
// Buffer stores the map name
                            // array.PushString(Buffer);
    
                        
} while (kv.GotoNextKey(false));
                    }
                }
            }
        }
    }
    
    
delete kv;

This is working for every mapgroup.
Ilusion9 is offline