From 32828a917934e8839ebf722a4411f66c7b9636c3 Mon Sep 17 00:00:00 2001 From: richard Date: Sat, 15 Aug 2009 02:58:49 +0200 Subject: [PATCH] Changed class configs to use yes/no. --- .../sourcemod/configs/zr/playerclasses.txt | 110 +++++++++--------- docs/zr_manual.txt | 10 +- src/zr/playerclasses/playerclasses.inc | 20 ++-- 3 files changed, 70 insertions(+), 70 deletions(-) diff --git a/cstrike/addons/sourcemod/configs/zr/playerclasses.txt b/cstrike/addons/sourcemod/configs/zr/playerclasses.txt index ea6be44..1640aad 100644 --- a/cstrike/addons/sourcemod/configs/zr/playerclasses.txt +++ b/cstrike/addons/sourcemod/configs/zr/playerclasses.txt @@ -10,12 +10,12 @@ // // Attribute: Values: Description: // ---------------------------------------------------------------------------- -// enabled 0/1 Enables or disables a class. +// enabled yes/no Enables or disables a class. // team number Specifies what team the class belongs to: // 0 - Zombies // 1 - Humans // 2 - Admin mode classes (incomplete feautre!) -// team_default 0/1 Marks the class as the default class in the team. +// team_default yes/no Marks the class as the default class in the team. // flags number Special class flags (bit field). To combine multiple flags // use a sum of the flag values. Available flags: // 1 - Admins only @@ -28,13 +28,13 @@ // alpha_damaged number Transparency when damaged. // alpha_damage number How much damage to do before switching alpha. // overlay_path text Overlay displayed at the player. -// nvgs 0/1 Give night vision. +// nvgs yes/no Give night vision. // fov number Field of view value. 90 is default. -// has_napalm 0/1 Allows player to throw napalm grenades. Humans only. +// has_napalm yes/no Allows player to throw napalm grenades. Humans only. // napalm_time decimal Napalm burn duration. Zombies only. // immunity_mode number Sets the immunity mode. // immunity_amount decimal Sets the immunity value. -// no_fall_damage 0/1 Disables fall damage. +// no_fall_damage on/off Disables fall damage. // health number How many health points to give. // health_regen_interval decimal Sets the regeneration interval. 0 to disable. // health_regen_amount number How much HP to give per interval. @@ -55,9 +55,9 @@ "zombie_classic" { // General - "enabled" "1" + "enabled" "yes" "team" "0" - "team_default" "1" + "team_default" "yes" "flags" "0" "group" "" @@ -72,17 +72,17 @@ // Hud "overlay_path" "overlays/zr/zvision" - "nvgs" "0" + "nvgs" "no" "fov" "90" // Effects - "has_napalm" "0" + "has_napalm" "no" "napalm_time" "10.0" // Player behaviour "immunity_mode" "0" "immunity_amount" "0.0" - "no_fall_damage" "1" + "no_fall_damage" "yes" "health" "2500" "health_regen_interval" "0.0" @@ -99,9 +99,9 @@ "zombie_fast" { // General - "enabled" "1" + "enabled" "yes" "team" "0" - "team_default" "0" + "team_default" "no" "flags" "0" "group" "" @@ -116,17 +116,17 @@ // Hud "overlay_path" "overlays/zr/zvision" - "nvgs" "0" + "nvgs" "no" "fov" "90" // Effects - "has_napalm" "0" + "has_napalm" "no" "napalm_time" "5.0" // Player behaviour "immunity_mode" "0" "immunity_amount" "0.0" - "no_fall_damage" "1" + "no_fall_damage" "yes" "health" "2000" "health_regen_interval" "0.0" @@ -143,9 +143,9 @@ "zombie_mutated" { // General - "enabled" "1" + "enabled" "yes" "team" "0" - "team_default" "0" + "team_default" "no" "flags" "0" "group" "" @@ -160,17 +160,17 @@ // Hud "overlay_path" "overlays/zr/zvision" - "nvgs" "0" + "nvgs" "no" "fov" "90" // Effects - "has_napalm" "0" + "has_napalm" "no" "napalm_time" "15.0" // Player behaviour "immunity_mode" "0" "immunity_amount" "0.0" - "no_fall_damage" "1" + "no_fall_damage" "yes" "health" "3500" "health_regen_interval" "0.0" @@ -187,9 +187,9 @@ "zombie_heavy" { // General - "enabled" "1" + "enabled" "yes" "team" "0" - "team_default" "0" + "team_default" "no" "flags" "0" "group" "" @@ -204,17 +204,17 @@ // Hud "overlay_path" "overlays/zr/zvision" - "nvgs" "0" + "nvgs" "no" "fov" "90" // Effects - "has_napalm" "0" + "has_napalm" "no" "napalm_time" "20.0" // Player behaviour "immunity_mode" "0" "immunity_amount" "0.0" - "no_fall_damage" "1" + "no_fall_damage" "yes" "health" "4000" "health_regen_interval" "0.0" @@ -231,9 +231,9 @@ "mother_zombie" { // General - "enabled" "1" + "enabled" "yes" "team" "0" - "team_default" "0" + "team_default" "no" "flags" "2" "group" "" @@ -248,7 +248,7 @@ // Hud "overlay_path" "overlays/zr/zvision" - "nvgs" "0" + "nvgs" "no" "fov" "110" // Effects @@ -258,7 +258,7 @@ // Player behaviour "immunity_mode" "0" "immunity_amount" "0.0" - "no_fall_damage" "1" + "no_fall_damage" "yes" "health" "2500" "health_regen_interval" "0.25" @@ -275,9 +275,9 @@ "mother_zombie_admin" { // General - "enabled" "1" + "enabled" "yes" "team" "0" - "team_default" "0" + "team_default" "no" "flags" "3" "group" "" @@ -292,7 +292,7 @@ // Hud "overlay_path" "overlays/zr/zvision" - "nvgs" "0" + "nvgs" "no" "fov" "110" // Effects @@ -302,7 +302,7 @@ // Player behaviour "immunity_mode" "0" "immunity_amount" "0.0" - "no_fall_damage" "1" + "no_fall_damage" "yes" "health" "3500" "health_regen_interval" "0.25" @@ -325,9 +325,9 @@ "human_normal" { // General - "enabled" "1" + "enabled" "yes" "team" "1" - "team_default" "1" + "team_default" "yes" "flags" "0" "group" "" @@ -342,17 +342,17 @@ // Hud "overlay_path" "" - "nvgs" "0" + "nvgs" "no" "fov" "90" // Effects - "has_napalm" "1" + "has_napalm" "yes" "napalm_time" "0.0" // Player behaviour "immunity_mode" "0" "immunity_amount" "0.0" - "no_fall_damage" "0" + "no_fall_damage" "no" "health" "100" "health_regen_interval" "0.0" @@ -369,9 +369,9 @@ "human_vip" { // General - "enabled" "1" + "enabled" "yes" "team" "1" - "team_default" "0" + "team_default" "yes" "flags" "0" "group" "" @@ -386,7 +386,7 @@ // Hud "overlay_path" "" - "nvgs" "0" + "nvgs" "no" "fov" "90" // Effects @@ -396,7 +396,7 @@ // Player behaviour "immunity_mode" "0" "immunity_amount" "0.0" - "no_fall_damage" "0" + "no_fall_damage" "no" "health" "200" "health_regen_interval" "1.0" @@ -413,9 +413,9 @@ "human_admin" { // General - "enabled" "1" + "enabled" "yes" "team" "1" - "team_default" "0" + "team_default" "no" "flags" "1" "group" "" @@ -430,7 +430,7 @@ // Hud "overlay_path" "" - "nvgs" "0" + "nvgs" "no" "fov" "90" // Effects @@ -440,7 +440,7 @@ // Player behaviour "immunity_mode" "0" "immunity_amount" "0.0" - "no_fall_damage" "1" + "no_fall_damage" "yes" "health" "200" "health_regen_interval" "1.0" @@ -457,9 +457,9 @@ "human_speedy" { // General - "enabled" "1" + "enabled" "yes" "team" "1" - "team_default" "0" + "team_default" "no" "flags" "0" "group" "" @@ -474,11 +474,11 @@ // Hud "overlay_path" "" - "nvgs" "0" + "nvgs" "no" "fov" "90" // Effects - "has_napalm" "0" + "has_napalm" "no" "napalm_time" "0.0" // Player behaviour @@ -501,9 +501,9 @@ "human_light" { // General - "enabled" "1" + "enabled" "yes" "team" "1" - "team_default" "0" + "team_default" "no" "flags" "0" "group" "" @@ -518,17 +518,17 @@ // Hud "overlay_path" "" - "nvgs" "0" + "nvgs" "no" "fov" "90" // Effects - "has_napalm" "1" + "has_napalm" "yes" "napalm_time" "0.0" // Player behaviour "immunity_mode" "0" "immunity_amount" "0.0" - "no_fall_damage" "0" + "no_fall_damage" "no" "health" "100" "health_regen_interval" "0.0" diff --git a/docs/zr_manual.txt b/docs/zr_manual.txt index 3ac1f1c..a9d2670 100644 --- a/docs/zr_manual.txt +++ b/docs/zr_manual.txt @@ -604,7 +604,7 @@ The list below explains all available class attributes in detail: Attribute: Value type: Limits/Requirements: =========================================================================== - enabled boolean 0 or 1 + enabled text "yes" or "no" --------------------------------------------------------------------------- Enables or disables the class. Disabled classes won't show up in the class selection menus. Also, if some attributes failed to validate the @@ -627,7 +627,7 @@ The list below explains all available class attributes in detail: See the "flags" attribute for admin-only classes. - team_default boolean 0 or 1 + team_default text "yes" or "no" --------------------------------------------------------------------------- Marks the class as the default class for its specified team. This class will be automatically selected on new players when they join the @@ -699,7 +699,7 @@ The list below explains all available class attributes in detail: controlled by the night vision key ("n" by default). The path is relative to "cstrike/materials". Leave blank to disable. - nvgs boolean 0 or 1 + nvgs text "yes" or "no" --------------------------------------------------------------------------- Gives night vision to the player. @@ -708,7 +708,7 @@ The list below explains all available class attributes in detail: The field of view on the player. Note that the weapon hud disappear if FOV is anything else than 90. - has_napalm boolean 0 or 1 + has_napalm text "yes" or "no" --------------------------------------------------------------------------- Human classes only. Specifies whether the human can trow napalm grenades or not. @@ -730,7 +730,7 @@ The list below explains all available class attributes in detail: The value for the specified immunity mode. This feature is currently incomplete and values are ignored. - no_fall_damage boolean 0 or 1 + no_fall_damage text "yes" or "no" --------------------------------------------------------------------------- Blocks fall damage on the player. diff --git a/src/zr/playerclasses/playerclasses.inc b/src/zr/playerclasses/playerclasses.inc index 65915aa..85c9be9 100644 --- a/src/zr/playerclasses/playerclasses.inc +++ b/src/zr/playerclasses/playerclasses.inc @@ -100,9 +100,9 @@ * @section Overall default class settings. Since this is a zombie plugin the * default values represent a zombie. */ -#define ZR_CLASS_DEFAULT_ENABLED true +#define ZR_CLASS_DEFAULT_ENABLED "yes" #define ZR_CLASS_DEFAULT_TEAM ZR_CLASS_TEAM_ZOMBIES -#define ZR_CLASS_DEFAULT_TEAM_DEFAULT true +#define ZR_CLASS_DEFAULT_TEAM_DEFAULT "yes" #define ZR_CLASS_DEFAULT_FLAGS 0 #define ZR_CLASS_DEFAULT_GROUP "" #define ZR_CLASS_DEFAULT_NAME "classic" @@ -112,13 +112,13 @@ #define ZR_CLASS_DEFAULT_ALPHA_DAMAGED 255 #define ZR_CLASS_DEFAULT_ALPHA_DAMAGE 0 #define ZR_CLASS_DEFAULT_OVERLAY_PATH "overlays/zr/zvision" -#define ZR_CLASS_DEFAULT_NVGS true +#define ZR_CLASS_DEFAULT_NVGS "no" #define ZR_CLASS_DEFAULT_FOV 90 -#define ZR_CLASS_DEFAULT_HAS_NAPALM 1 +#define ZR_CLASS_DEFAULT_HAS_NAPALM "yes" #define ZR_CLASS_DEFAULT_NAPALM_TIME 10.0 #define ZR_CLASS_DEFAULT_IMMUNITY_MODE ZR_CLASS_IMMUNITY_DISABLED #define ZR_CLASS_DEFAULT_IMMUNITY_AMOUNT 0.0 -#define ZR_CLASS_DEFAULT_NO_FALL_DAMAGE true +#define ZR_CLASS_DEFAULT_NO_FALL_DAMAGE "on" #define ZR_CLASS_DEFAULT_HEALTH 6000 #define ZR_CLASS_DEFAULT_HEALTH_REGEN_INTERVAL 0.0 #define ZR_CLASS_DEFAULT_HEALTH_REGEN_AMOUNT 2 @@ -495,9 +495,9 @@ ClassLoad(bool:keepMultipliers = false) } /* General */ - ClassData[ClassCount][Class_Enabled] = bool:KvGetNum(kvClassData, "enabled", ZR_CLASS_DEFAULT_ENABLED); + ClassData[ClassCount][Class_Enabled] = ConfigKvGetStringBool(kvClassData, "enabled", ZR_CLASS_DEFAULT_ENABLED); ClassData[ClassCount][Class_Team] = KvGetNum(kvClassData, "team", ZR_CLASS_DEFAULT_TEAM); - ClassData[ClassCount][Class_TeamDefault] = bool:KvGetNum(kvClassData, "team_default", ZR_CLASS_DEFAULT_TEAM_DEFAULT); + ClassData[ClassCount][Class_TeamDefault] = ConfigKvGetStringBool(kvClassData, "team_default", ZR_CLASS_DEFAULT_TEAM_DEFAULT); ClassData[ClassCount][Class_Flags] = KvGetNum(kvClassData, "flags", ZR_CLASS_DEFAULT_FLAGS); KvGetString(kvClassData, "group", group, sizeof(group), ZR_CLASS_DEFAULT_GROUP); @@ -523,19 +523,19 @@ ClassLoad(bool:keepMultipliers = false) KvGetString(kvClassData, "overlay_path", overlay_path, sizeof(overlay_path), ZR_CLASS_DEFAULT_OVERLAY_PATH); strcopy(ClassData[ClassCount][Class_OverlayPath], PLATFORM_MAX_PATH, overlay_path); - ClassData[ClassCount][Class_Nvgs] = bool:KvGetNum(kvClassData, "nvgs", ZR_CLASS_DEFAULT_NVGS); + ClassData[ClassCount][Class_Nvgs] = ConfigKvGetStringBool(kvClassData, "nvgs", ZR_CLASS_DEFAULT_NVGS); ClassData[ClassCount][Class_Fov] = KvGetNum(kvClassData, "fov", ZR_CLASS_DEFAULT_FOV); /* Effects */ - ClassData[ClassCount][Class_HasNapalm] = bool:KvGetNum(kvClassData, "have_napalm", ZR_CLASS_DEFAULT_HAS_NAPALM); + ClassData[ClassCount][Class_HasNapalm] = ConfigKvGetStringBool(kvClassData, "have_napalm", ZR_CLASS_DEFAULT_HAS_NAPALM); ClassData[ClassCount][Class_NapalmTime] = KvGetFloat(kvClassData, "napalm_time", ZR_CLASS_DEFAULT_NAPALM_TIME); /* Player behaviour */ ClassData[ClassCount][Class_ImmunityMode] = KvGetNum(kvClassData, "immunity_mode", ZR_CLASS_DEFAULT_IMMUNITY_MODE); ClassData[ClassCount][Class_ImmunityAmount] = KvGetFloat(kvClassData, "immunity_amount", ZR_CLASS_DEFAULT_IMMUNITY_AMOUNT); - ClassData[ClassCount][Class_NoFallDamage] = bool:KvGetNum(kvClassData, "no_fall_damage", ZR_CLASS_DEFAULT_NO_FALL_DAMAGE); + ClassData[ClassCount][Class_NoFallDamage] = ConfigKvGetStringBool(kvClassData, "no_fall_damage", ZR_CLASS_DEFAULT_NO_FALL_DAMAGE); ClassData[ClassCount][Class_Health] = KvGetNum(kvClassData, "health", ZR_CLASS_DEFAULT_HEALTH); ClassData[ClassCount][Class_HealthRegenInterval] = KvGetFloat(kvClassData, "health_regen_interval", ZR_CLASS_DEFAULT_HEALTH_REGEN_INTERVAL);