# HG changeset patch # User David Anderson # Date 1182799031 0 # Node ID 2200d290d7ce7131e073a47b0efc74abba260c81 # Parent bf8615181357fd20003805e548f40998f638aab4 - changed some config defaults - removed cssdm_equip_cfg - added cssdm_enable_equipment diff -r bf8615181357 -r 2200d290d7ce cfg/cssdm.cfg --- a/cfg/cssdm.cfg Sun Jun 24 22:10:00 2007 +0000 +++ b/cfg/cssdm.cfg Mon Jun 25 19:17:11 2007 +0000 @@ -11,7 +11,7 @@ // Default: "0" cssdm_ffa_enabled "0" -// Sets the CS:S DM spawn method.\ +// Sets the CS:S DM spawn method. // "none" -- Spawn at the normal map spawn points. // "preset" -- Spawn at a random point from a config file. // -- @@ -37,29 +37,35 @@ // Default: "0" cssdm_allow_c4 "0" +// Sets whether the equipment plugin is enabled. +// -- +// Requires: dm_equipment.smx +// Default: "1" +cssdm_enable_equipment "1" + // Whether or not spawn protection is enabled. // -- -// Requires: spawnprotection.smx +// Requires: sm_spawn_protection.smx // Default: "1" cssdm_spawn_protection "1" // Number of seconds a client is protected for. // -- -// Requires: spawnprotection.smx +// Requires: sm_spawn_protection.smx // Default: "2" cssdm_prot_time "2" // Sets the spawn protection color for CTs. // Format is "r g b a" (red, green, blue, alpha) // -- -// Requires: spawnprotection.smx +// Requires: sm_spawn_protection.smx // Default: "0 0 255 50" cssdm_prot_ctcolor "0 0 255 128" // Sets the spawn protection color for Ts. // Format is "r g b a" (red, green, blue, alpha) // -- -// Requires: spawnprotection.smx +// Requires: sm_spawn_protection.smx // Default: "255 0 0 50" cssdm_prot_tcolor "255 0 0 128" @@ -67,26 +73,26 @@ // Note that this command does not let players respawn before the // cssdm_respawn_wait time. // -- -// Requires: dmbasics.smx +// Requires: dm_basics.smx // Default: "1" cssdm_respawn_command "1" // Sets whether CS:S DM should force mapchanges. // This is useful for Stripper:Source users. // -- -// Requires: dmbasics.smx +// Requires: dm_basics.smx // Default: "0" cssdm_force_mapchanges "0" // Sets the mapchange file CS:S DM should use. // This is only needed for cssdm_force_mapchanges. // -- -// Requres: dmbasics.smx +// Requres: dm_basics.smx // Default: "mapcycle.txt" cssdm_mapchange_file "mapcycle.txt" // Sets whether CS:S DM should automatically refill ammo. // -- -// Requires: dmbasics.smx +// Requires: dm_basics.smx // Default: "1" -cssdm_refill_ammo "1" \ No newline at end of file +cssdm_refill_ammo "1" diff -r bf8615181357 -r 2200d290d7ce cfg/cssdm.equip.txt --- a/cfg/cssdm.equip.txt Sun Jun 24 22:10:00 2007 +0000 +++ b/cfg/cssdm.equip.txt Mon Jun 25 19:17:11 2007 +0000 @@ -21,7 +21,7 @@ "primary" "yes" // Secondary gun menu - "secondary" "random" + "secondary" "yes" // Normal CS:S buy menu/commands "buy" "no" @@ -42,13 +42,13 @@ "helmet" "yes" // Number of flashbangs to give - "flashbangs" "2" + "flashbangs" "0" // Whether to give a smoke grenade - "smokegrenade" "yes" + "smokegrenade" "no" // Whether to give an HE grenade - "hegrenade" "yes" + "hegrenade" "no" // whether to give defusekits to CTs "defusekits" "yes" diff -r bf8615181357 -r 2200d290d7ce scripting/dm_equipment.sp --- a/scripting/dm_equipment.sp Sun Jun 24 22:10:00 2007 +0000 +++ b/scripting/dm_equipment.sp Mon Jun 25 19:17:11 2007 +0000 @@ -30,7 +30,7 @@ #define CSSDM_GUNMENU_RANDOM 2 /** Plugin Stuff */ -new Handle:g_hEquipCfg = INVALID_HANDLE; /* cssdm_equip_cfg cvar */ +new Handle:cssdm_enable_equipment; /** cssdm_enable_equipment cvar */ new g_ArmorOffset = -1; /* m_ArmorValue offset */ new g_NVOffset = -1; /* m_bHasNightVision offset */ new g_HealthOffset = -1; /* m_iHealth offset */ @@ -94,7 +94,7 @@ RegConsoleCmd("say", Command_Say); RegConsoleCmd("say_team", Command_Say); - g_hEquipCfg = CreateConVar("cssdm_equip_cfg", "cssdm.equip.txt", "CS:S DM Equipment Config File"); + cssdm_enable_equipment = CreateConVar("cssdm_enable_equipment", "1", "Sets whether the equipment plugin is enabled"); g_ArmorOffset = FindSendPropOffs("CCSPlayer", "m_ArmorValue"); g_NVOffset = FindSendPropOffs("CCSPlayer", "m_bHasNightVision"); g_HealthOffset = FindSendPropOffs("CCSPlayer", "m_iHealth"); @@ -113,34 +113,27 @@ { LoadDefaults(); - decl String:cvar[64]; - GetConVarString(g_hEquipCfg, cvar, sizeof(cvar)); - - if (cvar[0] == '\0') + if (!GetConVarInt(cssdm_enable_equipment)) { + g_IsEnabled = false; + return; + } + + if ((g_IsEnabled = LoadConfigFile("cfg/cssdm/cssdm.equip.txt")) == false) + { + LogError("[CSSDM] Could not find equipment file \"%s\"", "cfg/cssdm/cssdm.equip.txt"); return; } + /** See if there is a map version */ + decl String:map[64]; decl String:path[255]; - Format(path, sizeof(path), "cfg/cssdm/%s", cvar); - - if ((g_IsEnabled = LoadConfigFile(path)) == false) - { - LogError("[CSSDM] Could not find equipment file \"%s\"", path); - return; - } + GetCurrentMap(map, sizeof(map)); + Format(path, sizeof(path), "cfg/cssdm/%s/cssdm.equip.txt", map); - if (strcmp(cvar, "cssdm.equip.txt") == 0) + if (FileExists(path)) { - /** See if there is a map version */ - decl String:map[64]; - GetCurrentMap(map, sizeof(map)); - Format(path, sizeof(path), "cfg/cssdm/%s/cssdm.equip.txt", map); - - if (FileExists(path)) - { - LoadConfigFile(path); - } + LoadConfigFile(path); } }