csdm reapi hud hp fix #2

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
273
Реакции
2
Ошибка
Возвращается хп худ при поднятии или покупки бомбы или оружия которое хукает c4 по обе стороны
ОС
Windows
Amx Mod X
AMX Mod X 1.10.0.5420 (http://www.amxmodx.org)
Билд
ReHLDS version: 3.8.0.739-dev
ReGamedll
ReGameDLL version: 5.20.0.516-dev
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Список метамодулей
[ 1] AMX Mod X     RUN   -    amxmodx_mm.dll        v1.10.0.5420     ini  Start ANY
[ 2] Reunion RUN - reunion_mm.dll v0.1.0.92 ini Start Never
[ 3] ReSemiclip RUN - resemiclip_mm.dll v2.3.9 ini Chlvl ANY
[ 4] ReAuthCheck RUN - reauthcheck_mm.dll v0.1.6 ini Start Never
[ 5] CStrike RUN - cstrike_amxx.dll v1.10.0.5420 pl1 ANY ANY
[ 6] CSX RUN - csx_amxx.dll v1.10.0.5420 pl1 ANY ANY
[ 7] Ham Sandwich RUN - hamsandwich_amxx.dll v1.10.0.5420 pl1 ANY ANY
[ 8] FakeMeta RUN - fakemeta_amxx.dll v1.10.0.5420 pl1 ANY ANY
[ 9] ReAPI RUN - reapi_amxx.dll v5.19.0.211-dev pl1 ANY Never
Список плагинов
[  1] 0   unknown                 unknown     unknown           unknown                          admin_loade  bad load 
[ 2] 1 Admin Base 1.10.0.541 AMXX Dev Team admin.amxx running
[ 3] 2 unknown unknown unknown unknown fresh_bans. bad load
[ 4] 3 Admin Chat 1.10.0.541 AMXX Dev Team adminchat.a running
[ 5] 4 Admin Commands 1.10.0.541 AMXX Dev Team admincmd.am running
[ 6] 5 Anti Flood 1.10.0.541 AMXX Dev Team antiflood.a running
[ 7] 6 Commands Menu 1.10.0.541 AMXX Dev Team cmdmenu.amx running
[ 8] 7 Info. Messages 1.10.0.541 AMXX Dev Team imessage.am running
[ 9] 8 Menus Front-End 1.10.0.541 AMXX Dev Team menufront.a running
[ 10] 9 Maps Menu 1.10.0.541 AMXX Dev Team mapsmenu.am running
[ 11] 10 NextMap 1.10.0.541 AMXX Dev Team nextmap.amx running
[ 12] 11 Nextmap Chooser 1.10.0.541 AMXX Dev Team mapchooser. running
[ 13] 12 Players Menu 1.10.0.541 AMXX Dev Team plmenu.amxx running
[ 14] 13 Plugin Menu 1.10.0.541 AMXX Dev Team pluginmenu. running
[ 15] 14 Restrict Weapons 1.10.0.541 AMXX Dev Team restmenu.am running
[ 16] 15 TimeLeft 1.10.0.541 AMXX Dev Team timeleft.am running
[ 17] 16 Scrolling Message 1.10.0.541 AMXX Dev Team scrollmsg.a running
[ 18] 17 Admin Votes 1.10.0.541 AMXX Dev Team adminvote.a running
[ 19] 18 CS Misc. Stats 1.10.0.541 AMXX Dev Team miscstats.a running
[ 20] 19 CS Stats Logging 1.10.0.541 AMXX Dev Team stats_loggi running
[ 21] 20 Stats Configuration 1.10.0.541 AMXX Dev Team statscfg.am running
[ 22] 21 Simple Damager 2.1.0 fl0wer simple_dama running
[ 23] 22 CSDM Core v1.0.0 wopox1337 CSDM_ReAPI/ debug
[ 24] 23 CSDM Equip Manager v1.0.0 wopox1337 CSDM_ReAPI/ debug
[ 25] 24 CSDM Map Cleaner v1.0.0 wopox1337 CSDM_ReAPI/ debug
[ 26] 25 CSDM Misc v1.0.0 wopox1337 CSDM_ReAPI/ debug
[ 27] 26 CSDM Protection v1.0.0 wopox1337 CSDM_ReAPI/ debug
[ 28] 27 CSDM Spawn Manager v1.0.0 wopox1337 CSDM_ReAPI/ debug
Автор плагина
wopox1337
Версия плагина
1.0.1
Исходный код
#include <amxmodx>
#include <hamsandwich>
#include <csdm>


#define IsPlayer(%1) (1 <= (%1) <= g_iMaxPlayers)

const HideWeapon_Flags = 1 // "HideWeapon" msg argument

new const g_szWeaponList[][] =
{
"weapon_m4a1",
"weapon_usp",
"weapon_famas",
"weapon_glock18"
}

new HamHook:g_hSecondaryAttack[sizeof(g_szWeaponList)], HamHook:g_hAddToPlayer[sizeof(g_szWeaponList)]

new g_bWeaponState[MAX_CLIENTS + 1][CSW_P90 + 1]
new g_iMaxPlayers

new bool:g_bWeaponStateRemember = true, g_bitHideHudFlags, g_iRefillClip = 1


public plugin_init()
{
register_plugin("CSDM Misc", CSDM_VERSION, "wopox1337")

for(new i = 0; i < sizeof(g_szWeaponList); i++)
{
DisableHamForward(g_hAddToPlayer[i] = RegisterHam(Ham_Item_AddToPlayer, g_szWeaponList[i], "CBasePlayerItem_AddToPlayer", .Post = true))
DisableHamForward(g_hSecondaryAttack[i] = RegisterHam(Ham_Weapon_SecondaryAttack, g_szWeaponList[i], "CBasePlayerItem_SecAttack", .Post = true))
}

g_iMaxPlayers = get_maxplayers()
}

public plugin_cfg()
{
CheckForwards()
}

public client_putinserver(pPlayer)
{
g_bWeaponState[pPlayer][CSW_M4A1] = g_bWeaponState[pPlayer][CSW_USP] = g_bWeaponState[pPlayer][CSW_FAMAS] = g_bWeaponState[pPlayer][CSW_GLOCK18] = 0;
}


public CSDM_Initialized(const szVersion[])
{
if(!szVersion[0])
pause("ad")
}

public CSDM_ConfigurationLoad(const ReadTypes:iReadAction)
{
CSDM_RegisterConfig("misc", "ReadCfg")
}

public CSDM_PlayerKilled(const pVictim, const pKiller, const HitBoxGroup:iLastHitGroup)
{
if(!g_iRefillClip || !pKiller)
return

if(pVictim != pKiller && is_user_alive(pKiller))
{
switch(g_iRefillClip)
{
case 1:
{
new pActiveWeapon = get_member(pKiller, m_pActiveItem)
if(!is_nullent(pActiveWeapon)) {
rg_instant_reload_weapons(pKiller, pActiveWeapon)
}
}
case 2: rg_instant_reload_weapons(pKiller) // all
}
}
}

public CBasePlayerItem_SecAttack(const pWeapon)
{
if(pWeapon <= 0)
return HAM_IGNORED

new pPlayer = get_member(pWeapon, m_pPlayer)
if(IsPlayer(pPlayer)) {
g_bWeaponState[pPlayer][get_member(pWeapon, m_iId)] = get_member(pWeapon, m_Weapon_iWeaponState)
}

return HAM_IGNORED
}

public CBasePlayerItem_AddToPlayer(const pWeapon, const pPlayer)
{
if(pWeapon > 0 && IsPlayer(pPlayer)) {
set_member(pWeapon, m_Weapon_iWeaponState, g_bWeaponState[pPlayer][get_member(pWeapon, m_iId)])
}

return HAM_IGNORED
}

public Message_HideWeapon(const iMsgId, const iMsgDest, const iMsgEntity)
{
if(g_bitHideHudFlags) {
set_msg_arg_int(HideWeapon_Flags, ARG_BYTE, get_msg_arg_int(HideWeapon_Flags) | g_bitHideHudFlags)
}
}

public ReadCfg(const szLineData[], const iSectionID)
{
new szKey[MAX_KEY_LEN], szValue[MAX_VALUE_LEN], szSign[2]
if(!ParseConfigKey(szLineData, szKey, szSign, szValue))
return

if(equali(szKey, "weaponstate_remember"))
{
g_bWeaponStateRemember = bool:(str_to_num(szValue))
}
else if(equali(szKey, "refill_clip_weapons"))
{
g_iRefillClip = clamp(str_to_num(szValue), 0, 2)
}
else if(equali(szKey, "hide_hud_flags"))
{
if(ContainFlag(szValue, "c"))
g_bitHideHudFlags |= HIDEHUD_CROSSHAIR
if(ContainFlag(szValue, "f"))
g_bitHideHudFlags |= HIDEHUD_FLASHLIGHT
if(ContainFlag(szValue, "m"))
g_bitHideHudFlags |= HIDEHUD_MONEY
if(ContainFlag(szValue, "h"))
g_bitHideHudFlags |= HIDEHUD_HEALTH
if(ContainFlag(szValue, "t"))
g_bitHideHudFlags |= HIDEHUD_TIMER
}
}

CheckForwards()
{
static iMsgIdHideWeapon, iMsgHookHideWeapon
if(!iMsgIdHideWeapon) {
iMsgIdHideWeapon = get_user_msgid("HideWeapon")
}

for(new i = 0; i < sizeof(g_szWeaponList); i++)
{
if(g_bWeaponStateRemember)
{
EnableHamForward(g_hAddToPlayer[i])
EnableHamForward(g_hSecondaryAttack[i])
}
else
{
DisableHamForward(g_hAddToPlayer[i])
DisableHamForward(g_hSecondaryAttack[i])
}
}

if(g_bitHideHudFlags && !iMsgHookHideWeapon)
{
iMsgHookHideWeapon = register_message(iMsgIdHideWeapon, "Message_HideWeapon")
}
else if(!g_bitHideHudFlags && iMsgHookHideWeapon)
{
unregister_message(iMsgIdHideWeapon, iMsgHookHideWeapon)
iMsgHookHideWeapon = 0
}
}
и при отключении в настройках худа хп если купить оружие которое хукает бомбу на 5й слот как у тт так кт то возвращается худ с хп
вот даже скрины где после покупки я киллялся за атаку и потом подбирал якобы бомбу и мне возвращался худ
 
В этой теме было размещено решение! Перейти к решению.

Download all Attachments

Сообщения
3,593
Реакции
1,576
Помог
141 раз(а)
Так а где исход того плагина? И почему его нет в списке?
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу