Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "Maps.Config"
- {
- //Map Configuration File
- //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- //"exact_map_name"
- //{
- // "#" "execution" //#" *MUST* start at 1 and *MUST* increase by one for each following value.
- //}
- //- Any additional " must be replaced with \"
- //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- "testmap"
- {
- "cvar" "value"
- "cvar" "value"
- "cvar" "value"
- "cvar" "value"
- "cvar" "value"
- }
- }
- ReadMapConfigs()
- {
- decl String:sPath[PLATFORM_MAX_PATH];
- BuildPath(Path_SM, sPath, sizeof(sPath), "configs/kvconfigs.maps.ini");
- g_bMapConfigs = false;
- new iSize, Handle:hKeyValues = CreateKeyValues("KvConfigs.Maps");
- if(FileToKeyValues(hKeyValues, sPath) && KvGotoFirstSubKey(hKeyValues))
- {
- g_bMapConfigs = true;
- do
- {
- iSize = GetArraySize(g_hArray_MapCvars);
- KvGetSectionName(hKeyValues, sPath, sizeof(sPath));
- SetTrieValue(g_hTrie_MapCvars, sPath, iSize);
- ResizeArray(g_hArray_MapCvars, iSize + 1);
- new Handle:hCvar = CreateArray(64);
- new Handle:hAction = CreateArray(64);
- if(KvGotoFirstSubKey(hKeyValues, false))
- {
- do
- {
- KvGetSectionName(hKeyValues, sPath, sizeof(sPath));
- PushArrayString(hCvar, sPath);
- KvGetString(hKeyValues, NULL_STRING, sPath, sizeof(sPath));
- PushArrayString(hAction, sPath);
- }
- while (KvGotoNextKey(hKeyValues, false));
- KvGoBack(hKeyValues);
- }
- SetArrayCell(g_hArray_MapCvars, iSize, hCvar, 0);
- SetArrayCell(g_hArray_MapCvars, iSize, hAction, 1);
- }
- while (KvGotoNextKey(hKeyValues));
- CloseHandle(hKeyValues);
- }
- return iSize;
- }
Advertisement
Add Comment
Please, Sign In to add comment