From d3e5957215b7f3cb75aaffd92fd12529a4776c42 Mon Sep 17 00:00:00 2001 From: Arkshine Date: Wed, 15 Jul 2015 22:57:57 +0200 Subject: [PATCH] Cstrike: Add cstrike_const.inc and move existing constants there --- .../cstrike/cstrike/msvc12/cstrike.vcxproj | 1 + .../cstrike/msvc12/cstrike.vcxproj.filters | 3 + plugins/include/cstrike.inc | 116 +-------------- plugins/include/cstrike_const.inc | 133 ++++++++++++++++++ support/PackageScript | 1 + 5 files changed, 139 insertions(+), 115 deletions(-) create mode 100644 plugins/include/cstrike_const.inc diff --git a/modules/cstrike/cstrike/msvc12/cstrike.vcxproj b/modules/cstrike/cstrike/msvc12/cstrike.vcxproj index e50b7f14..f4fb687b 100644 --- a/modules/cstrike/cstrike/msvc12/cstrike.vcxproj +++ b/modules/cstrike/cstrike/msvc12/cstrike.vcxproj @@ -167,6 +167,7 @@ + diff --git a/modules/cstrike/cstrike/msvc12/cstrike.vcxproj.filters b/modules/cstrike/cstrike/msvc12/cstrike.vcxproj.filters index 33e30dbe..d7d54327 100644 --- a/modules/cstrike/cstrike/msvc12/cstrike.vcxproj.filters +++ b/modules/cstrike/cstrike/msvc12/cstrike.vcxproj.filters @@ -99,5 +99,8 @@ Pawn Includes + + Pawn Includes + \ No newline at end of file diff --git a/plugins/include/cstrike.inc b/plugins/include/cstrike.inc index 041d35d9..3649bd4a 100755 --- a/plugins/include/cstrike.inc +++ b/plugins/include/cstrike.inc @@ -21,121 +21,7 @@ #pragma loadlib cstrike #endif -/** - * @section Team and team model constants, used by cs_[get|set]_user_team(). - */ - -/** - * Internal Counter-Strike model id constants. - * - * @note Model ids starting with CZ_ are only valid in Condition Zero. - */ -enum CsInternalModel -{ - CS_NORESET = -1, - CS_DONTCHANGE = 0, - CS_CT_URBAN = 1, - CS_T_TERROR = 2, - CS_T_LEET = 3, - CS_T_ARCTIC = 4, - CS_CT_GSG9 = 5, - CS_CT_GIGN = 6, - CS_CT_SAS = 7, - CS_T_GUERILLA = 8, - CS_CT_VIP = 9, - CZ_T_MILITIA = 10, - CZ_CT_SPETSNAZ = 11, -}; - -/** - * Counter-Strike team id constants. - */ -enum CsTeams -{ - CS_TEAM_UNASSIGNED = 0, - CS_TEAM_T = 1, - CS_TEAM_CT = 2, - CS_TEAM_SPECTATOR = 3, -}; - -/** - * @endsection - */ - -/** - * Counter-Strike armor types for use with cs_[get|set]_user_armor(). - */ -enum CsArmorType -{ - CS_ARMOR_NONE = 0, // no armor - CS_ARMOR_KEVLAR = 1, // body vest only - CS_ARMOR_VESTHELM = 2, // vest and helmet -}; - -/** - * Map zone flags returned by cs_get_user_mapzones(). - */ -#define CS_MAPZONE_BUY (1<<0) // Buyzone -#define CS_MAPZONE_BOMBTARGET (1<<1) // Bomb target zone -#define CS_MAPZONE_HOSTAGE_RESCUE (1<<2) // Hostage rescue zone -#define CS_MAPZONE_ESCAPE (1<<3) // Terrorist escape zone -#define CS_MAPZONE_VIP_SAFETY (1<<4) // VIP escape zone - -/** - * Constants used for cs_[get|set]_user_zoom(). - */ -enum -{ - CS_RESET_ZOOM = 0, // Reset any zoom blocking (mode has no effect) - CS_SET_NO_ZOOM, // Disable any sort of zoom - CS_SET_FIRST_ZOOM, // Set first zoom level (AWP style) - CS_SET_SECOND_ZOOM, // Set second zoom level (AWP style) - CS_SET_AUGSG552_ZOOM, // Set AUG/SG552 zoom style -}; - -/** - * Constants used for the CS_OnBuy() and CS_OnBuyAttempt() forwards. - * - * @note While these mostly overlap with the CSW_* constants the CSI_* constants - * contain custom AMXX values that do not correspond to any real value in - * the game. The CSI_* constants should therefore be used for consistency. - */ -#define CSI_P228 CSW_P228 -#define CSI_SCOUT CSW_SCOUT -#define CSI_HEGRENADE CSW_HEGRENADE -#define CSI_XM1014 CSW_XM1014 -#define CSI_C4 CSW_C4 -#define CSI_MAC10 CSW_MAC10 -#define CSI_AUG CSW_AUG -#define CSI_SMOKEGRENADE CSW_SMOKEGRENADE -#define CSI_ELITE CSW_ELITE -#define CSI_FIVESEVEN CSW_FIVESEVEN -#define CSI_UMP45 CSW_UMP45 -#define CSI_SG550 CSW_SG550 -#define CSI_GALIL CSW_GALIL -#define CSI_FAMAS CSW_FAMAS -#define CSI_USP CSW_USP -#define CSI_GLOCK18 CSW_GLOCK18 -#define CSI_AWP CSW_AWP -#define CSI_MP5NAVY CSW_MP5NAVY -#define CSI_M249 CSW_M249 -#define CSI_M3 CSW_M3 -#define CSI_M4A1 CSW_M4A1 -#define CSI_TMP CSW_TMP -#define CSI_G3SG1 CSW_G3SG1 -#define CSI_FLASHBANG CSW_FLASHBANG -#define CSI_DEAGLE CSW_DEAGLE -#define CSI_SG552 CSW_SG552 -#define CSI_AK47 CSW_AK47 -#define CSI_P90 CSW_P90 -#define CSI_SHIELDGUN CSW_SHIELDGUN // The real CS value, use CSI_SHELD instead. -#define CSI_VEST CSW_VEST // Custom -#define CSI_VESTHELM CSW_VESTHELM // Custom -#define CSI_DEFUSER 33 // Custom -#define CSI_NVGS 34 // Custom -#define CSI_PRIAMMO 36 // Custom -#define CSI_SECAMMO 37 // Custom -#define CSI_SHIELD 38 // Custom - The value passed by the forward, more convenient for plugins. +#include /** * Returns client's deaths. diff --git a/plugins/include/cstrike_const.inc b/plugins/include/cstrike_const.inc new file mode 100644 index 00000000..46fb2772 --- /dev/null +++ b/plugins/include/cstrike_const.inc @@ -0,0 +1,133 @@ +// vim: set ts=4 sw=4 tw=99 noet: +// +// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). +// Copyright (C) The AMX Mod X Development Team. +// +// This software is licensed under the GNU General Public License, version 3 or higher. +// Additional exceptions apply. For full license details, see LICENSE.txt or visit: +// https://alliedmods.net/amxmodx-license + +// +// Counter-Strike Functions +// + +#if defined _cstrike_const_included + #endinput +#endif +#define _cstrike_const_included + +/** + * @section Team and team model constants, used by cs_[get|set]_user_team(). + */ + +/** + * Internal Counter-Strike model id constants. + * + * @note Model ids starting with CZ_ are only valid in Condition Zero. + */ +enum CsInternalModel +{ + CS_DONTCHANGE = 0, + CS_CT_URBAN = 1, + CS_T_TERROR = 2, + CS_T_LEET = 3, + CS_T_ARCTIC = 4, + CS_CT_GSG9 = 5, + CS_CT_GIGN = 6, + CS_CT_SAS = 7, + CS_T_GUERILLA = 8, + CS_CT_VIP = 9, + CZ_T_MILITIA = 10, + CZ_CT_SPETSNAZ = 11, +}; + +/** + * Counter-Strike team id constants. + */ +enum CsTeams +{ + CS_TEAM_UNASSIGNED = 0, + CS_TEAM_T = 1, + CS_TEAM_CT = 2, + CS_TEAM_SPECTATOR = 3, +}; + +/** + * @endsection + */ + +/** + * Counter-Strike armor types for use with cs_[get|set]_user_armor(). + */ +enum CsArmorType +{ + CS_ARMOR_NONE = 0, // no armor + CS_ARMOR_KEVLAR = 1, // body vest only + CS_ARMOR_VESTHELM = 2, // vest and helmet +}; + +/** + * Map zone flags returned by cs_get_user_mapzones(). + */ +#define CS_MAPZONE_BUY (1<<0) // Buyzone +#define CS_MAPZONE_BOMBTARGET (1<<1) // Bomb target zone +#define CS_MAPZONE_HOSTAGE_RESCUE (1<<2) // Hostage rescue zone +#define CS_MAPZONE_ESCAPE (1<<3) // Terrorist escape zone +#define CS_MAPZONE_VIP_SAFETY (1<<4) // VIP escape zone + +/** + * Constants used for cs_[get|set]_user_zoom(). + */ +enum +{ + CS_RESET_ZOOM = 0, // Reset any zoom blocking (mode has no effect) + CS_SET_NO_ZOOM, // Disable any sort of zoom + CS_SET_FIRST_ZOOM, // Set first zoom level (AWP style) + CS_SET_SECOND_ZOOM, // Set second zoom level (AWP style) + CS_SET_AUGSG552_ZOOM, // Set AUG/SG552 zoom style +}; + +/** + * Constants used for the CS_OnBuy() and CS_OnBuyAttempt() forwards. + * + * @note While these mostly overlap with the CSW_* constants the CSI_* constants + * contain custom AMXX values that do not correspond to any real value in + * the game. The CSI_* constants should therefore be used for consistency. + */ +#define CSI_P228 CSW_P228 +#define CSI_SCOUT CSW_SCOUT +#define CSI_HEGRENADE CSW_HEGRENADE +#define CSI_XM1014 CSW_XM1014 +#define CSI_C4 CSW_C4 +#define CSI_MAC10 CSW_MAC10 +#define CSI_AUG CSW_AUG +#define CSI_SMOKEGRENADE CSW_SMOKEGRENADE +#define CSI_ELITE CSW_ELITE +#define CSI_FIVESEVEN CSW_FIVESEVEN +#define CSI_UMP45 CSW_UMP45 +#define CSI_SG550 CSW_SG550 +#define CSI_GALIL CSW_GALIL +#define CSI_FAMAS CSW_FAMAS +#define CSI_USP CSW_USP +#define CSI_GLOCK18 CSW_GLOCK18 +#define CSI_AWP CSW_AWP +#define CSI_MP5NAVY CSW_MP5NAVY +#define CSI_M249 CSW_M249 +#define CSI_M3 CSW_M3 +#define CSI_M4A1 CSW_M4A1 +#define CSI_TMP CSW_TMP +#define CSI_G3SG1 CSW_G3SG1 +#define CSI_FLASHBANG CSW_FLASHBANG +#define CSI_DEAGLE CSW_DEAGLE +#define CSI_SG552 CSW_SG552 +#define CSI_AK47 CSW_AK47 +#define CSI_P90 CSW_P90 +#define CSI_SHIELDGUN CSW_SHIELDGUN // The real CS value, use CSI_SHELD instead. +#define CSI_VEST CSW_VEST // Custom +#define CSI_VESTHELM CSW_VESTHELM // Custom +#define CSI_DEFUSER 33 // Custom +#define CSI_NVGS 34 // Custom +#define CSI_PRIAMMO 36 // Custom +#define CSI_SECAMMO 37 // Custom +#define CSI_SHIELD 38 // Custom - The value passed by the forward, more convenient for plugins. + diff --git a/support/PackageScript b/support/PackageScript index 1d42f07e..314a861f 100644 --- a/support/PackageScript +++ b/support/PackageScript @@ -273,6 +273,7 @@ scripting_files = [ 'include/core.inc', 'include/csstats.inc', 'include/cstrike.inc', + 'include/cstrike_const.inc', 'include/csx.inc', 'include/cvars.inc', 'include/datapack.inc',