Armor Damage

Сообщения
1,543
Реакции
1,543
Предупреждения
1
Помог
2 раз(а)
Ошибка
Ошибки нет - Сервер зависает в рандомном времени
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5271
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
Exe build: 13:12:29 Aug 29 2013 (6153)
ReGamedll
нету
Версия Metamod
Metamod v1.21p38  2018/02/11 (5:13)
Список метамодулей
Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] SafeNameAndChat RUN - safenameandchat. v1.1 ini ANY ANY
[ 2] AMX Mod X RUN - amxmodx_mm_i386. v1.9.0.5 ini Start ANY
[ 3] dproto_EF RUN - dproto_i386.so v0.9.391 ini Start Never
[ 4] InfoIsValid Fix RUN - infovalidfix.so v0.2 ini ANY Never
[ 5] LocalizeBug Fix RUN - localizebugfix_m v2.4 ini Start Never
[ 6] VoiceTranscoder RUN - voicetranscoder. v2017RC3 ini ANY ANY
[ 7] FullupdatePatch RUN - fullupd_patch_mm v1.2 ini Start Never
[ 8] CustomizationEx RUN - cef.so v0.0.2 ini ANY ANY
[ 9] NetBufExtender RUN - nbex.so v1.0 ini ANY Never
[10] UserInfoNetOpti RUN - uino.so v1.0 ini ANY Never
[11] DontFragRemover RUN - dontfragremover. v1.0 ini ANY ANY
[12] AntiHang RUN - antihang_mm_i386 v0.1 ini Start Never
[13] Enable CSBot RUN - csbot.so vApr 13 ini ANY Pause
[14] Fun RUN - fun_amxx_i386.so v1.9.0.5 pl1 ANY ANY
[15] Engine RUN - engine_amxx_i386 v1.9.0.5 pl1 ANY ANY
[16] FakeMeta RUN - fakemeta_amxx_i3 v1.9.0.5 pl1 ANY ANY
[17] CStrike RUN - cstrike_amxx_i38 v1.9.0.5 pl1 ANY ANY
[18] CSX RUN - csx_amxx_i386.so v1.9.0.5 pl1 ANY ANY
[19] Ham Sandwich RUN - hamsandwich_amxx v1.9.0.5 pl1 ANY ANY
[20] MySQL RUN - mysql_amxx_i386. v1.9.0.5 pl1 ANY ANY
20 plugins, 20 running
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] MultiMod Manager 2.2 JoRoPiTo multimod.amxx running
[ 2] Nextmap Chooser 1.9.0 AMXX Dev Team mapchooser_mult running
[ 3] Block MinModels 1.0 MayroN cl_minmodels.am running
[ 4] Third Person Camera 1.0 MayroN 3rd_person.amxx running
[ 5] Game Name WarCraft 1.0 MayroN gamename_wc.amx running
[ 6] unknown unknown unknown precache_sound_ running
[ 7] Players Count in Team 2.0 kramesa select_team_wc. running
[ 8] unknown unknown unknown random_class_te running
[ 9] Timeleft as Roundtime AcidoX 1.0 timeleft_hud.am running
[ 10] Warcraft 3 Frozen Thro 3.0 RC4 Geesu & Avanderi war3ft.amxx running
[ 11] Descriptive 'Fire in t 0.1 VEN descriptive_fir running
[ 12] Gas Poison 2.0.1 ConnorMcLeod gas_poison.amxx running
[ 13] Back Weapons 1.87 hoboman313; chea backweapons_wc. running
[ 14] Weather System 2.9c UFPS.Team weather_system. running
[ 15] Weapon Icon 1.2 hoboman313/Zenix weapon_icon.amx running
[ 16] Super Bunny Hopper 1.2 Cheesy Peteza bhop.amxx running
[ 17] Grentrail 1.3 AssKicR grentrail2.amxx running
[ 18] AMXX Public server rul 1.20 Priski public_rules.am running
[ 19] Spectator Banner Ads 0.1.16 iG_os spec_banner_wc. running
[ 20] Killer Effect Sprite C 3.6 Yek'-ta killer_effect_w running
[ 21] Sprite Damage 1.0 Lie damage_wc.amxx running
[ 22] Weapons Models 0.2.3 ConnorMcLeod Weapons_Models_ running
[ 23] Vampire 1.0d Shalfey vampire.amxx running
[ 24] Remove Drop Weapon 0.3 GordonFreeman & remove_drop_wea running
[ 25] Autoresponder/Advertis 0.5 MaximusBrood ad_manager_wc.a running
[ 26] Weapon Trail 2.0 anakin_cstrike WeaponTrail.amx running
[ 27] Custom Smoke 1.07 bionext Smoke_Effect.am running
[ 28] Flashbang Dynamic Ligh 0.10 Avalanche flashbang_dligh running
[ 29] Weapon Lights 0.6 HiSS & Arkshine weapon_lights.a running
[ 30] First Person Death 1.0 Numb first_person_de running
[ 31] Info. Messages 1.9.0 AMXX Dev Team imessage.amxx running
[ 32] TimeLeft 1.9.0 AMXX Dev Team timeleft.amxx running
[ 33] Sniper Crosshairs 1.3 Numb sniper_crosshai running
[ 34] unknown unknown unknown block_message_w running
[ 35] hl_adrenaline_upd 0.2a Turanga_Leela cs_adrenaline_u running
[ 36] Damage Effects 1.0.0 TaRgEt*TuRkEy damageeffects.a running
[ 37] Players Models 1.3.1 ConnorMcLeod player_model_wc running
[ 38] Timelimit 1.0 F wc_timelimit.am running
[ 39] buytime 1.0 F wc_buytime.amxx running
[ 40] unknown unknown unknown motd_wc.amxx running
[ 41] C4 Smoke 1.0 fl0wer backpack_smoke. running
[ 42] Death Sprite 1.0 DarkGL Death.amxx running
[ 43] Players Drop Money 1.7 Sh!nE* drop_money_wc.a running
[ 44] Xmas shit 1.0 xPaw & Juice dragons_wc.amxx running
[ 45] Xmas shit 1.0 xPaw & Juice bush_wc.amxx running
[ 46] Xmas shit 1.0 xPaw & Juice bush2_wc.amxx running
[ 47] Xmas shit 1.0 xPaw & Juice tree_wc.amxx running
[ 48] Xmas shit 1.0 xPaw & Juice tree2_wc.amxx running
[ 49] Snake Bomb 1.0 MayroN snake_bomb.amxx running
[ 50] Snake Defuse Predictio 1.2 Starsailor snake_defuse_pr running
[ 51] RockTheVote_MultiMod 1.8 DA rockthevote_mul running
[ 52] Last Round 2.0 many last_round.amxx running
[ 53] Warcraft Item Bot 1.1 DA Item_bot_war3ft running
[ 54] Death Medkit Drop 4.2 tuty; 731; Midni medkit_wc.amxx running
[ 55] Armor Damage 1.0 Simon Logic armor_damage.am running
[ 56] Armor Drop 1.0 OneEyed armor_wc.amxx running
[ 57] Throw Knife WC 1.0.2 -]ToC[-Bludy/JTP throw_knife.amx running
[ 58] unknown unknown unknown bind_command_wc running
[ 59] Box WC 3.1 Alexander.3 box_wc.amxx running
[ 60] Lie Flat 1.1 Nomexous lie_flat.amxx running
[ 61] Weapon Physics 2.1 Nomexous weaponphys.amxx running
[ 62] WinTeam Sprite 0.0.8 Some Scripter WinTeam_Sprite_ running
[ 63] unknown unknown unknown block_sound_win running
[ 64] Bomb Change Message 0.0.1 Flymic24 bomb_change_mes running
[ 65] Bomb Block Beep 1.2 MayroN / edit St bomb_block_beep running
[ 66] C4Timer 1.0 F c4_timer_wc.amx running
[ 67] Win Sounds 1.0 OciXCrom win_sound_wc.am running
[ 68] AMXX Public server rul 1.20 Priski support_thanks. running
[ 69] Bilbord Girl 1.0 xPaw & Juice bilbord_girl.am running
[ 70] CHAT MODEL 3.0 MayroN & Sanya@ chat_model.amxx running
[ 71] Automatic Unstuck 1.5 NL)Ramon(NL automatic_unstu running
[ 72] Bot AutoKill 1.0 Sanya@ bot_autokill.am running
72 plugins, 72 running
Автор плагина
Simon Logic
Версия плагина
1.0
Исходный код
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta_stocks>
#include <hamsandwich>

#define PLUGIN_NAME "Armor Damage"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "Simon Logic"

#define MAX_IMMORTAL_HEALTH 254.0

new bool:g_bCS
new g_iMaxPlayers
new g_msgDamage
new g_msgHealth
new g_msgBattery
new g_cvarAffectDmgBits
new g_cvarAffectGenericDmg
new g_cvarAffectKnifeDmg

new bool:bHamBot = false;

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)

g_bCS = bool:cstrike_running()
g_iMaxPlayers = get_maxplayers()
g_msgDamage = get_user_msgid("Damage")
g_msgHealth = get_user_msgid("Health")
g_msgBattery = get_user_msgid("Battery")

g_cvarAffectDmgBits = register_cvar("q3armor_affectdmgbits", "abcdefghijklmnopqrstuvy")
g_cvarAffectGenericDmg = register_cvar("q3armor_affectgenericdmg", "1")
if(g_bCS)
g_cvarAffectKnifeDmg = register_cvar("q3armor_affectknifedmg", "1")

RegisterHam(Ham_TakeDamage, "player", "onPlayerDamage")
RegisterHam(Ham_Spawn, "player", "Give_Armor", 1)
}

public client_putinserver(id)
{
if(!bHamBot && is_user_bot(id))
{
bHamBot = true
set_task(0.1, "Bot_Give_Armor", id)
}
}

public Bot_Give_Armor(id)
{
RegisterHamFromEntity(Ham_TakeDamage, id, "onPlayerDamage")
RegisterHamFromEntity(Ham_Spawn, id, "Give_Armor", 1)
}

public Give_Armor(id)
{
if(!is_user_alive(id))
return HAM_IGNORED;

cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM);

return HAM_IGNORED;
}

public onPlayerDamage(victim, inflictor, attacker, Float:dmg, dmg_type)
{
static iAffDmgBits; iAffDmgBits = getCvarAsFlags(g_cvarAffectDmgBits)

if(dmg_type == DMG_GENERIC)
{
if(!get_pcvar_num(g_cvarAffectGenericDmg))
return HAM_IGNORED
}
else if(!(dmg_type & iAffDmgBits))
{
return HAM_IGNORED
}
if(pev_valid(victim))
{
static Float:fArmor; pev(victim, pev_armorvalue, fArmor)
if(fArmor > 0.0)
{
if(g_bCS && !get_pcvar_num(g_cvarAffectKnifeDmg)
&& 1 <= attacker <= g_iMaxPlayers)
{
new iDummy
if(CSW_KNIFE == get_user_weapon(attacker, iDummy, iDummy))
return HAM_IGNORED
}

static Float:fHealth; pev(victim, pev_health, fHealth)
if(dmg < fHealth + fArmor)
{
set_pev(victim, pev_health, MAX_IMMORTAL_HEALTH)

new iBlockDamage; iBlockDamage = get_msg_block(g_msgDamage)
new iBlockHealth; iBlockHealth = get_msg_block(g_msgHealth)
new iBlockBattery; iBlockBattery = get_msg_block(g_msgBattery)

set_msg_block(g_msgDamage, BLOCK_SET)
set_msg_block(g_msgHealth, BLOCK_SET)
set_msg_block(g_msgBattery, BLOCK_SET)
ExecuteHam(Ham_TakeDamage, victim, inflictor, attacker, dmg, dmg_type)
set_msg_block(g_msgDamage, iBlockDamage)
set_msg_block(g_msgHealth, iBlockHealth)
set_msg_block(g_msgBattery, iBlockBattery)

new Float:fNewArmor; pev(victim, pev_armorvalue, fNewArmor)
new Float:fNewHealth; pev(victim, pev_health, fNewHealth)
fNewHealth -= MAX_IMMORTAL_HEALTH
fNewHealth += fHealth

if(fNewArmor > 0 && fNewHealth != fHealth)
{
new Float:fDmgTake = fHealth - fNewHealth
fNewArmor -= fDmgTake
if(fNewArmor < 0.0)
{
fDmgTake = fNewArmor
fNewArmor = 0.0
}
else
fDmgTake = 0.0

fNewHealth = fHealth + fDmgTake

if(fNewHealth < 0.0)
fNewHealth = 0.0

set_pev(victim, pev_armorvalue, fNewArmor)
}
set_pev(victim, pev_health, fNewHealth)

new Float:fInflictorOrigin[3]

if(pev_valid(inflictor))
pev(inflictor, pev_origin, fInflictorOrigin)

new iDmgSave = floatround(fArmor - fNewArmor)
new iDmgTake = floatround(fHealth - fNewHealth)

emessage_begin(MSG_ONE, g_msgDamage, _, victim)
ewrite_byte(iDmgSave)
ewrite_byte(iDmgTake)
ewrite_long(dmg_type)
ewrite_coord(floatround(fInflictorOrigin[0]))
ewrite_coord(floatround(fInflictorOrigin[1]))
ewrite_coord(floatround(fInflictorOrigin[2]))
emessage_end()

return HAM_SUPERCEDE
}
}
}
return HAM_IGNORED
}

stock getCvarAsFlags(const pcvar)
{
static sValue[27]
get_pcvar_string(pcvar, sValue, sizeof(sValue)-1)
return read_flags(sValue)
}
Из этой темы https://dev-cs.ru/threads/16380/ я узнал причину падения сервера
Виной только этот плагин - в логах чистота, а в дебаге лишь это
#0 0xff91c0c8 in ?? ()
#0 0xff91c0c8 in ?? ()
Да я понимаю старый код и всё такое,но здесь именно есть всё то, что мне нужно помимо остальных аналогов - броня забирается абсолютно во всех случаях,так как и положено без какого либо умножения, и со всеми флагами DMG_....

Прошу помощи в исправлении
Или, если кто знает свежий вариант плагина - то подскажите,просто ещё не встречал
 

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

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