- changed some config defaults
authorDavid Anderson <dvander@alliedmods.net>
Mon Jun 25 19:17:11 2007 +0000 (2007-06-25)
changeset 32200d290d7ce
parent 2 bf8615181357
child 4 6db3288d2e63
- changed some config defaults
- removed cssdm_equip_cfg
- added cssdm_enable_equipment
cfg/cssdm.cfg
cfg/cssdm.equip.txt
scripting/dm_equipment.sp
     1.1 --- a/cfg/cssdm.cfg	Sun Jun 24 22:10:00 2007 +0000
     1.2 +++ b/cfg/cssdm.cfg	Mon Jun 25 19:17:11 2007 +0000
     1.3 @@ -11,7 +11,7 @@
     1.4  // Default: "0"
     1.5  cssdm_ffa_enabled "0"
     1.6  
     1.7 -// Sets the CS:S DM spawn method.\
     1.8 +// Sets the CS:S DM spawn method.
     1.9  // "none"   -- Spawn at the normal map spawn points.
    1.10  // "preset" -- Spawn at a random point from a config file.
    1.11  // --
    1.12 @@ -37,29 +37,35 @@
    1.13  // Default: "0"
    1.14  cssdm_allow_c4 "0"
    1.15  
    1.16 +// Sets whether the equipment plugin is enabled.
    1.17 +// --
    1.18 +// Requires: dm_equipment.smx
    1.19 +// Default: "1"
    1.20 +cssdm_enable_equipment "1"
    1.21 +
    1.22  // Whether or not spawn protection is enabled.
    1.23  // --
    1.24 -// Requires: spawnprotection.smx
    1.25 +// Requires: sm_spawn_protection.smx
    1.26  // Default: "1"
    1.27  cssdm_spawn_protection "1"
    1.28  
    1.29  // Number of seconds a client is protected for.
    1.30  // --
    1.31 -// Requires: spawnprotection.smx
    1.32 +// Requires: sm_spawn_protection.smx
    1.33  // Default: "2"
    1.34  cssdm_prot_time "2"
    1.35  
    1.36  // Sets the spawn protection color for CTs.
    1.37  // Format is "r g b a" (red, green, blue, alpha)
    1.38  // --
    1.39 -// Requires: spawnprotection.smx
    1.40 +// Requires: sm_spawn_protection.smx
    1.41  // Default: "0 0 255 50"
    1.42  cssdm_prot_ctcolor "0 0 255 128"
    1.43  
    1.44  // Sets the spawn protection color for Ts.
    1.45  // Format is "r g b a" (red, green, blue, alpha)
    1.46  // --
    1.47 -// Requires: spawnprotection.smx
    1.48 +// Requires: sm_spawn_protection.smx
    1.49  // Default: "255 0 0 50"
    1.50  cssdm_prot_tcolor "255 0 0 128"
    1.51  
    1.52 @@ -67,26 +73,26 @@
    1.53  // Note that this command does not let players respawn before the
    1.54  // cssdm_respawn_wait time.
    1.55  // --
    1.56 -// Requires: dmbasics.smx
    1.57 +// Requires: dm_basics.smx
    1.58  // Default: "1"
    1.59  cssdm_respawn_command "1"
    1.60  
    1.61  // Sets whether CS:S DM should force mapchanges.
    1.62  // This is useful for Stripper:Source users.
    1.63  // --
    1.64 -// Requires: dmbasics.smx
    1.65 +// Requires: dm_basics.smx
    1.66  // Default: "0"
    1.67  cssdm_force_mapchanges "0"
    1.68  
    1.69  // Sets the mapchange file CS:S DM should use.
    1.70  // This is only needed for cssdm_force_mapchanges.
    1.71  // --
    1.72 -// Requres: dmbasics.smx
    1.73 +// Requres: dm_basics.smx
    1.74  // Default: "mapcycle.txt"
    1.75  cssdm_mapchange_file "mapcycle.txt"
    1.76  
    1.77  // Sets whether CS:S DM should automatically refill ammo.
    1.78  // --
    1.79 -// Requires: dmbasics.smx
    1.80 +// Requires: dm_basics.smx
    1.81  // Default: "1"
    1.82 -cssdm_refill_ammo "1"
    1.83 \ No newline at end of file
    1.84 +cssdm_refill_ammo "1"
     2.1 --- a/cfg/cssdm.equip.txt	Sun Jun 24 22:10:00 2007 +0000
     2.2 +++ b/cfg/cssdm.equip.txt	Mon Jun 25 19:17:11 2007 +0000
     2.3 @@ -21,7 +21,7 @@
     2.4  		"primary"		"yes"
     2.5  		
     2.6  		// Secondary gun menu
     2.7 -		"secondary"		"random"
     2.8 +		"secondary"		"yes"
     2.9  		
    2.10  		// Normal CS:S buy menu/commands
    2.11  		"buy"			"no"
    2.12 @@ -42,13 +42,13 @@
    2.13  		"helmet"		"yes"
    2.14  		
    2.15  		// Number of flashbangs to give
    2.16 -		"flashbangs"	"2"
    2.17 +		"flashbangs"	"0"
    2.18  		
    2.19  		// Whether to give a smoke grenade
    2.20 -		"smokegrenade"	"yes"
    2.21 +		"smokegrenade"	"no"
    2.22  		
    2.23  		// Whether to give an HE grenade
    2.24 -		"hegrenade"		"yes"
    2.25 +		"hegrenade"		"no"
    2.26  
    2.27  		// whether to give defusekits to CTs
    2.28  		"defusekits"	"yes"
     3.1 --- a/scripting/dm_equipment.sp	Sun Jun 24 22:10:00 2007 +0000
     3.2 +++ b/scripting/dm_equipment.sp	Mon Jun 25 19:17:11 2007 +0000
     3.3 @@ -30,7 +30,7 @@
     3.4  #define CSSDM_GUNMENU_RANDOM	2
     3.5  
     3.6  /** Plugin Stuff */
     3.7 -new Handle:g_hEquipCfg = INVALID_HANDLE;			/* cssdm_equip_cfg cvar */
     3.8 +new Handle:cssdm_enable_equipment;					/** cssdm_enable_equipment cvar */
     3.9  new g_ArmorOffset = -1;								/* m_ArmorValue offset */
    3.10  new g_NVOffset = -1;								/* m_bHasNightVision offset */
    3.11  new g_HealthOffset = -1;							/* m_iHealth offset */
    3.12 @@ -94,7 +94,7 @@
    3.13  	RegConsoleCmd("say", Command_Say);
    3.14  	RegConsoleCmd("say_team", Command_Say);
    3.15  	
    3.16 -	g_hEquipCfg = CreateConVar("cssdm_equip_cfg", "cssdm.equip.txt", "CS:S DM Equipment Config File");
    3.17 +	cssdm_enable_equipment = CreateConVar("cssdm_enable_equipment", "1", "Sets whether the equipment plugin is enabled");
    3.18  	g_ArmorOffset = FindSendPropOffs("CCSPlayer", "m_ArmorValue");
    3.19  	g_NVOffset = FindSendPropOffs("CCSPlayer", "m_bHasNightVision");
    3.20  	g_HealthOffset = FindSendPropOffs("CCSPlayer", "m_iHealth");
    3.21 @@ -113,34 +113,27 @@
    3.22  {
    3.23  	LoadDefaults();
    3.24  	
    3.25 -	decl String:cvar[64];
    3.26 -	GetConVarString(g_hEquipCfg, cvar, sizeof(cvar));
    3.27 -	
    3.28 -	if (cvar[0] == '\0')
    3.29 +	if (!GetConVarInt(cssdm_enable_equipment))
    3.30  	{
    3.31 +		g_IsEnabled = false;
    3.32 +		return;
    3.33 +	}
    3.34 +		
    3.35 +	if ((g_IsEnabled = LoadConfigFile("cfg/cssdm/cssdm.equip.txt")) == false)
    3.36 +	{
    3.37 +		LogError("[CSSDM] Could not find equipment file \"%s\"", "cfg/cssdm/cssdm.equip.txt");
    3.38  		return;
    3.39  	}
    3.40  	
    3.41 +	/** See if there is a map version */
    3.42 +	decl String:map[64];
    3.43  	decl String:path[255];
    3.44 -	Format(path, sizeof(path), "cfg/cssdm/%s", cvar);
    3.45 -	
    3.46 -	if ((g_IsEnabled = LoadConfigFile(path)) == false)
    3.47 -	{
    3.48 -		LogError("[CSSDM] Could not find equipment file \"%s\"", path);
    3.49 -		return;
    3.50 -	}
    3.51 +	GetCurrentMap(map, sizeof(map));
    3.52 +	Format(path, sizeof(path), "cfg/cssdm/%s/cssdm.equip.txt", map);
    3.53  	
    3.54 -	if (strcmp(cvar, "cssdm.equip.txt") == 0)
    3.55 +	if (FileExists(path))
    3.56  	{
    3.57 -		/** See if there is a map version */
    3.58 -		decl String:map[64];
    3.59 -		GetCurrentMap(map, sizeof(map));
    3.60 -		Format(path, sizeof(path), "cfg/cssdm/%s/cssdm.equip.txt", map);
    3.61 -		
    3.62 -		if (FileExists(path))
    3.63 -		{
    3.64 -			LoadConfigFile(path);
    3.65 -		}
    3.66 +		LoadConfigFile(path);
    3.67  	}
    3.68  }
    3.69