L 02/22/2018 - 10:04:23: deploy: id 16, weapon 127, weaponid 12
L 02/22/2018 - 10:04:25: drop: id 2, weaponbox 167, weapon 199, weaponid 18
L 02/22/2018 - 10:04:25: holster: id 2, weapon 197, weaponid 29
L 02/22/2018 - 10:04:24: Plugins: id 40, weapon 127 , weaponid 12
L 02/22/2018 - 10:04:25: Plugins: id 40, weapon 127 , weaponid 12
L 02/22/2018 - 10:04:25: Plugins: id 40, weapon 127 , weaponid 12
L 02/22/2018 - 10:04:25: Start of error session.
L 02/22/2018 - 10:04:25: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20180222.log")
L 02/22/2018 - 10:04:25: [ReAPI] get_member: invalid or uninitialized entity
L 02/22/2018 - 10:04:25: [AMXX] Displaying debug trace (plugin "power_damage_test.amxx", version "0.1")
L 02/22/2018 - 10:04:25: [AMXX] Run time error 10: native error (native "get_member")
Код
if(is_user_connected(pevAttacker) && pevAttacker != this)
{
new id = get_user_userid(pevAttacker);
new weapon = get_member(pevAttacker, m_pActiveItem);
new weaponid = get_member(weapon, m_iId);
log_to_file("addons/amxmodx/configs/test1.txt", "Plugins: id %d, weapon %d , weaponid %d", id, weapon, weaponid);
if(wss_get_weapon_skin_index(weapon) && !(bitsDamageType & (DMG_GRENADE|DMG_BLAST)))
{
SetHookChainArg(4, ATYPE_FLOAT, flDamage * 1.4);
}
}
Строка ошибки new weaponid = get_member(weapon, m_iId); ...
public CBasePlayer_TakeDamage_Pre(const this, pevInflictor, pevAttacker, Float:flDamage, bitsDamageType)
{
if(is_user_connected(pevAttacker))
{
new weapon = get_member(pevAttacker, m_pActiveItem);
if(!is_entity(weapon))
{
new weaponid = get_member(weapon, m_iId);
log_to_file("addons/amxmodx/logs/test.txt", "weapon %d, weaponid %d", weapon, weaponid);
return HC_CONTINUE;
}
if(wss_get_weapon_skin_index(weapon) && !(bitsDamageType & (DMG_GRENADE|DMG_BLAST)))
{
SetHookChainArg(4, ATYPE_FLOAT, flDamage * 1.4);
}
}
return HC_CONTINUE;
}
L 02/23/2018 - 18:05:42: Start of error session.
L 02/23/2018 - 18:05:42: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20180223.log")
L 02/23/2018 - 18:05:42: [ReAPI] get_member: invalid or uninitialized entity
L 02/23/2018 - 18:05:42: [AMXX] Displaying debug trace (plugin "power_damage.amxx", version "0.1")
L 02/23/2018 - 18:05:42: [AMXX] Run time error 10: native error (native "get_member")
L 02/23/2018 - 18:05:42: [AMXX] [0] weapons_menu.sma::CBasePlayer_TakeDamage_Pre (line 9)
public CBasePlayer_TakeDamage_Pre(const this, pevInflictor, pevAttacker, Float:flDamage, bitsDamageType)
{
if(is_user_connected(pevAttacker) && !(bitsDamageType & (DMG_GRENADE|DMG_BLAST)))
{
new weapon = get_member(pevAttacker, m_pActiveItem);
log_to_file("addons/amxmodx/logs/test.txt", "weapon %d", weapon);
if(!is_entity(weapon))
{
new weaponid = get_member(weapon, m_iId);
log_to_file("addons/amxmodx/logs/test.txt", "weaponid %d", weaponid);
return HC_CONTINUE;
}
if(wss_get_weapon_skin_index(weapon))
{
SetHookChainArg(4, ATYPE_FLOAT, flDamage * 1.4);
}
}
return HC_CONTINUE;
}
- if(is_user_connected(pevAttacker)
+ if(is_user_connected(pevAttacker) && !(bitsDamageType & (DMG_GRENADE|DMG_BLAST)))
public CBasePlayer_TakeDamage_Pre(const this, pevInflictor, pevAttacker, Float:flDamage, bitsDamageType)
{
if(is_user_connected(pevAttacker) && (bitsDamageType & DMG_BULLET))
{
new weapon = get_member(pevAttacker, m_pActiveItem);
log_to_file("addons/amxmodx/logs/test.txt", "weapon %d", weapon);
new weaponid = get_member(weapon, m_iId);
log_to_file("addons/amxmodx/logs/test.txt", "weaponid %d", weaponid);
if(wss_get_weapon_skin_index(weapon))
{
SetHookChainArg(4, ATYPE_FLOAT, flDamage * 1.4);
}
}
return HC_CONTINUE;
}
добавляем фильтр поSonyx, записал хлтв демку, чтоб увидеть когда оно крашнется. В итоге крашнулось когда взорвалась бомба на даст2.
pevAttacker != pevInflictor
и радуемся жизни)public CBasePlayer_TakeDamage_Pre(const this, pevInflictor, pevAttacker, Float:flDamage, bitsDamageType)
{
if(is_user_connected(pevAttacker) && pevAttacker != this && pevAttacker != pevInflictor)
{
new weapon = get_member(pevAttacker, m_pActiveItem);
if(wss_get_weapon_skin_index(weapon))
{
SetHookChainArg(4, ATYPE_FLOAT, flDamage * 1.4);
}
}
}