Portugal
Пользователь
- Регистрация
- 2 Мар 2018
- Сообщения
- 257
- Симпатии
- 5
- Предупреждения
- 60
- Пол
- Мужской
- Amx Mod X
- AMXX 1.9.0-dev
- Ошибка
- Исходник
-
Код:Форматирование (BB-код):
#include <amxmodx> #include <reapi> #include <vip_system> #pragma semicolon 1 enum _:cvars { HP_OFF, HP_MAX, HP_BODY, HP_HS }; new pCvar[cvars], Float:HpMax, Float:HpBody, Float:HpHs, HpRoundOff; new HookChain:Player_Killed; new g_iSyncMsgAddHP; public plugin_init() { register_plugin("[ReVIP] Add HP", VIP_SYSTEM_VERSION, "pUzzlik"); pCvar[HP_OFF] = register_cvar("hp_add_raund", "1"); pCvar[HP_MAX] = register_cvar("hh_add_max", "120.0"); pCvar[HP_BODY] = register_cvar("hp_add_body", "15.0"); pCvar[HP_HS] = register_cvar("hp_add_hs", "25.0"); DisableHookChain(Player_Killed = RegisterHookChain(RG_CBasePlayer_Killed, "CBasePlayer_Killed", true)); if(get_block_maps()) pause("ad"); g_iSyncMsgAddHP = CreateHudSyncObj(); } public plugin_cfg() { HpMax = get_pcvar_float(pCvar[HP_MAX]); HpBody = get_pcvar_float(pCvar[HP_BODY]); HpHs = get_pcvar_float(pCvar[HP_HS]); HpRoundOff = get_pcvar_num(pCvar[HP_OFF]); } public vip_core_restart_round(iRound) if(iRound == HpRoundOff) EnableHookChain(Player_Killed); public CBasePlayer_Killed(const pevVictim, pevAttacker) { if(get_flag_access(pevAttacker) && pevVictim != pevAttacker) { static Float:attackerHp, Float:addHp; attackerHp = Float:get_entvar(pevAttacker, var_health); addHp = get_member(pevVictim, m_bHeadshotKilled) ? HpHs : HpBody; attackerHp += addHp; set_entvar(pevAttacker, var_health, attackerHp > HpMax ? HpMax : attackerHp); if(attackerHp >= HpMax) return; } return; }
Помогите поправить
Вложения
-
5,8 KB Просмотры: 17