Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "BuildWars.Settings"
- {
- //Rotation definitions available for clients to select from.
- //Used when clients are rotating their prop, and snapping rotations when controlling props.
- //Definition: "degrees" "default"
- //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- "Rotations"
- {
- "1.40625" "0"
- "2.8125" "0"
- "5.625" "0"
- "11.25" "0"
- "22.5" "0"
- "45.0" "1"
- "90.0" "0"
- }
- //Position definitions available for clients to select from.
- //Used when clients are moving props, and snapping positions when controlling props.
- //Definition: "units" "default"
- //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- "Positions"
- {
- "1.0" "0"
- "2.0" "1"
- "3.0" "0"
- "5.0" "0"
- "8.0" "0"
- "12.0" "0"
- "16.0" "0"
- "24.0" "0"
- "30.0" "0"
- }
- //Command definitions for determining how to access content of the plugin.
- //Definitions with sm_ result in both ! and / being created for usage.
- //Indexes:
- // 0 - BuildWars Menu
- // 1 - Rotate Prop Menu
- // 2 - Move Prop Menu
- // 3 - Delete Target Prop
- // 4 - Control Target Prop
- // 5 - Check Target Prop
- // 6 - Return To Spawn
- // 7 - Help Menu
- // 8 - Ready Status
- // 9 - Delete All Props
- // 10 - Toggle Third Person
- // 11 - Toggle Fly State
- // 12 - Clone Target Prop / Clone Grabbed Prop
- // 13 - Toggle Target Prop Phase
- //Definition: "command" "index"
- //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- "Commands"
- {
- "sm_prop" "0"
- "sm_props" "0"
- "sm_build" "0"
- "sm_rotate" "1"
- "sm_rot" "1"
- "sm_move" "2"
- "sm_pos" "2"
- "sm_position" "2"
- "sm_delete" "3"
- "sm_del" "3"
- "sm_grab" "4"
- "sm_control" "4"
- "sm_check" "5"
- "sm_trace" "5"
- "sm_tele" "6"
- "sm_stuck" "6"
- "sm_ztele" "6"
- "sm_zstuck" "6"
- "sm_help" "7"
- "sm_ready" "8"
- "sm_deleteall" "9"
- "sm_clear" "9"
- "sm_delall" "9"
- "sm_3rd" "10"
- "sm_third" "10"
- "sm_3rdperson" "10"
- "sm_thirdperson" "10"
- "sm_glide" "11"
- "sm_clone" "12"
- "sm_copy" "12"
- "sm_phase" "13"
- "sm_block" "13"
- }
- //Punishment definitions for the Gimp feature (restricts plugin features for targeted players)
- //Definition: "display" "seconds"
- "Durations"
- {
- "5 Minutes" "5"
- "10 Minutes" "10"
- "15 Minutes" "15"
- "20 Minutes" "20"
- "30 Minutes" "30"
- "45 Minutes" "45"
- "60 Minutes" "60"
- "2 Hours" "120"
- "3 Hours" "180"
- "6 Hours" "360"
- "12 Hours" "720"
- "24 Hours" "1440"
- "2 Days" "2880"
- "3 Days" "4320"
- "4 Days" "5760"
- "5 Days" "7200"
- "6 Days" "8640"
- "7 Days" "10080"
- }
- //Valid classnames of entities that can be used as walls to separate the two teams.
- //Definition: "classname" ""
- "Walls"
- {
- "func_breakable" ""
- "func_breakable_surf" ""
- "func_brush" ""
- "func_wall_toggle" ""
- }
- }
- Define_Settings()
- {
- decl String:sPath[PLATFORM_MAX_PATH], String:sBuffer[64];
- BuildPath(Path_SM, sPath, PLATFORM_MAX_PATH, "configs/buildwars/buildwars.settings.cfg");
- new iTemp, Handle:hKeyValues = CreateKeyValues("BuildWars.Settings");
- if(!FileToKeyValues(hKeyValues, sPath) || !KvGotoFirstSubKey(hKeyValues))
- SetFailState("BuildWars: Could not either locate or parse \"configs/buildwars/buildwars.settings.cfg\"");
- else
- {
- do
- {
- KvGetSectionName(hKeyValues, sPath, sizeof(sPath));
- if(StrEqual(sPath, "Rotations", false))
- {
- g_iCfg_TotalRotations = 0;
- g_iCfg_DefaultRotation = -1;
- KvGotoFirstSubKey(hKeyValues, false);
- do
- {
- KvGetSectionName(hKeyValues, sBuffer, sizeof(sBuffer));
- g_Cfg_fDefinedRotations[g_iCfg_TotalRotations] = StringToFloat(sBuffer);
- if((iTemp = KvGetNum(hKeyValues, NULL_STRING, 0)))
- g_iCfg_DefaultRotation = iTemp;
- g_iCfg_TotalRotations++;
- }
- while (KvGotoNextKey(hKeyValues, false));
- if(g_iCfg_DefaultRotation == -1)
- g_iCfg_DefaultRotation = GetRandomInt(0, (g_iCfg_TotalRotations - 1));
- KvGoBack(hKeyValues);
- }
- else if(StrEqual(sPath, "Positions", false))
- {
- g_iCfg_TotalPositions = 0;
- g_iCfg_DefaultPosition = -1;
- KvGotoFirstSubKey(hKeyValues, false);
- do
- {
- KvGetSectionName(hKeyValues, sBuffer, sizeof(sBuffer));
- g_Cfg_fDefinedPositions[g_iCfg_TotalPositions] = StringToFloat(sBuffer);
- if((iTemp = KvGetNum(hKeyValues, NULL_STRING, 0)))
- g_iCfg_DefaultPosition = iTemp;
- g_iCfg_TotalPositions++;
- }
- while (KvGotoNextKey(hKeyValues, false));
- if(g_iCfg_DefaultPosition == -1)
- g_iCfg_DefaultPosition = GetRandomInt(0, (g_iCfg_TotalPositions - 1));
- KvGoBack(hKeyValues);
- }
- else if(StrEqual(sPath, "Commands", false))
- {
- ClearTrie(g_hTrie_CfgDefinedCmds);
- KvGotoFirstSubKey(hKeyValues, false);
- do
- {
- KvGetSectionName(hKeyValues, sBuffer, sizeof(sBuffer));
- iTemp = KvGetNum(hKeyValues, NULL_STRING, 0);
- if(!StrContains(sBuffer, "sm_"))
- {
- strcopy(sPath, sizeof(sPath), sBuffer);
- ReplaceString(sPath, sizeof(sPath), "sm_", "!", false);
- SetTrieValue(g_hTrie_CfgDefinedCmds, sPath, iTemp);
- strcopy(sPath, sizeof(sPath), sBuffer);
- ReplaceString(sPath, sizeof(sPath), "sm_", "/", false);
- SetTrieValue(g_hTrie_CfgDefinedCmds, sPath, iTemp);
- }
- else
- SetTrieValue(g_hTrie_CfgDefinedCmds, sBuffer, iTemp);
- }
- while (KvGotoNextKey(hKeyValues, false));
- KvGoBack(hKeyValues);
- }
- else if(StrEqual(sPath, "Durations", false))
- {
- g_iCfg_TotalDurations = 0;
- KvGotoFirstSubKey(hKeyValues, false);
- do
- {
- KvGetSectionName(hKeyValues, g_Cfg_sGimpDisplays[g_iCfg_TotalDurations], sizeof(g_Cfg_sGimpDisplays[]));
- g_iCfg_GimpDurations[g_iCfg_TotalDurations] = KvGetNum(hKeyValues, NULL_STRING);
- g_iCfg_TotalDurations++;
- }
- while (KvGotoNextKey(hKeyValues, false));
- KvGoBack(hKeyValues);
- }
- else if(StrEqual(sPath, "Walls", false))
- {
- KvGotoFirstSubKey(hKeyValues, false);
- do
- {
- KvGetSectionName(hKeyValues, sBuffer, sizeof(sBuffer));
- SetTrieValue(g_hTrie_CfgWalls, sBuffer, 1);
- g_iCfg_TotalDurations++;
- }
- while (KvGotoNextKey(hKeyValues, false));
- KvGoBack(hKeyValues);
- }
- }
- while (KvGotoNextKey(hKeyValues));
- CloseHandle(hKeyValues);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment