diff --git a/addons/amxmodx/scripting/csgo_remake.sma b/addons/amxmodx/scripting/csgo_remake.sma index 1ab59c4..4861e8f 100644 --- a/addons/amxmodx/scripting/csgo_remake.sma +++ b/addons/amxmodx/scripting/csgo_remake.sma @@ -22,7 +22,7 @@ #pragma dynamic MAX_SKINS * 17 #define PLUGIN "CS:GO Remake" -#define VERSION "2.3.1" +#define VERSION "2.3.2" #define AUTHOR "Shadows Adi" #define CSGO_TAG "[CS:GO Remake]" @@ -35,27 +35,6 @@ #define SetPlayerBit(%0,%1) ( IsPlayer(%1) && ( %0 |= ( 1 << ( %1 & 31 ) ) ) ) #define ClearPlayerBit(%0,%1) ( %0 &= ~( 1 << ( %1 & 31 ) ) ) -#define XO_WEAPON 4 -#define XO_PLAYER 5 -#define OFFSET_WEAPONOWNER 41 -#define OFFSET_ID 43 -#define OFFSET_SECONDARY_ATTACK 47 -#define OFFSET_WEAPON_IDLE 48 -#define OFFSET_WEAPONCLIP 51 -#define OFFSET_WEAPON_IN_RELOAD 54 -#define OFFSET_WEAPONSTATE 74 -#define OFFSET_ACTIVE_ITEM 373 - -#define OBS_IN_EYE 4 - -#define WPNSTATE_USP_SILENCED (1<<0) -#define WPNSTATE_GLOCK18_BURST_MODE (1<<1) -#define WPNSTATE_M4A1_SILENCED (1<<2) -#define WPNSTATE_ELITE_LEFT (1<<3) -#define WPNSTATE_FAMAS_BURST_MODE (1<<4) -#define UNSIL 0 -#define SILENCED 1 - #define WEAPONTYPE_ELITE 1 #define WEAPONTYPE_GLOCK18 2 #define WEAPONTYPE_FAMAS 3 @@ -128,13 +107,9 @@ #define USP_SHOOT_SOUND "csgor/usp_unsil.wav" #define USP_SILENT_SOUND "csgor/usp.wav" -#define weaponsWithoutInspect ((1< 30) - { - return HAM_IGNORED - } + new ent = GetPlayerActiveItem(id) - if ((1 << weapon) & weaponsNotVaild) - { - return HAM_IGNORED - } + if(is_nullent(ent)) + return + + new weapon = GetWeaponEntity(ent) + + if (!IsValidWeapon(weapon) || (1 << weapon) & weaponsNotVaild) + return new imp = pev(ent, pev_impulse) if (0 < imp) - { - return HAM_IGNORED - } - - new id = get_pdata_cbase(ent, OFFSET_WEAPONOWNER, XO_WEAPON) - - if (!is_user_connected(id)) - { - return HAM_IGNORED - } + return new skin = (g_iStattrackWeap[id][bStattrack][weapon] ? g_iStattrackWeap[id][iSelected][weapon] : g_iUserSelectedSkin[id][weapon]) @@ -4586,8 +4459,6 @@ public Ham_Item_Can_Drop_Pre(ent) { set_pev(ent, pev_impulse, skin + 1) } - - return HAM_IGNORED } public _ShowOpenCaseCraftMenu(id) @@ -5049,7 +4920,7 @@ public _ShowMarketMenu(id) new n new p - get_players(Pl, n, "ch", "") + get_players(Pl, n, "ch") if (n) { @@ -10616,16 +10487,16 @@ public clcmd_say_skin(id) return PLUGIN_HANDLED } - new iActiveItem = get_pdata_cbase(player, OFFSET_ACTIVE_ITEM, XO_PLAYER) + new iActiveItem = GetPlayerActiveItem(player) - if(pev_valid(iActiveItem) != PDATA_SAFE) + if(is_nullent(iActiveItem)) { return PLUGIN_HANDLED } - new weapon = get_pdata_int(iActiveItem, OFFSET_ID, XO_WEAPON) + new weapon = GetWeaponEntity(iActiveItem) - if((1 << weapon) & weaponsWithoutSkin) + if((1 << weapon) & weaponsWithoutInspectSkin) { return PLUGIN_HANDLED } @@ -10833,13 +10704,13 @@ public inspect_weapon(id) log_to_file("csgor_debug_logs.log", "inspect_weapon()") #endif - if (pev_valid(id) != PDATA_SAFE || !is_user_alive(id) || cs_get_user_shield(id) || cs_get_user_zoom(id) > 1) return PLUGIN_HANDLED + if (is_nullent(id) || !is_user_alive(id) || cs_get_user_shield(id) || cs_get_user_zoom(id) > 1) return PLUGIN_HANDLED - new weaponId = get_user_weapon(id) - new weapon; - weapon = get_pdata_cbase(id, OFFSET_ACTIVE_ITEM, XO_PLAYER) - if(weaponsWithoutInspect & (1< 30) + return false + + return true +} + GetWeaponEntity(iEnt) { #if defined DEBUG log_to_file("csgor_debug_logs.log", "GetWeaponEntity()") #endif - return get_pdata_int(iEnt, OFFSET_ID, XO_WEAPON) + return get_member(iEnt, m_iId) } PlayWeaponState(iPlayer, const szShootSound[], iWeaponAnim) @@ -12162,13 +12049,18 @@ DoIntermission() emessage_end() } +SetWeaponModel(id, bool:bViewModel, model[]) +{ + set_pev(id, bViewModel ? pev_viewmodel2 : pev_weaponmodel2, model) +} + GetSkinInfo(player, weapon, iActiveItem) { new skin = -1 switch (weapon) { - case 29: + case CSW_KNIFE: { if(g_iStattrackWeap[player][bStattrack][weapon]) { @@ -12184,7 +12076,6 @@ GetSkinInfo(player, weapon, iActiveItem) skin = g_iUserSelectedSkin[player][weapon] } } - } default: {