Bug 4591 - register_event (Damage)
register_event (Damage)
Status: RESOLVED INVALID
Product: AMX Mod X
Classification: Unclassified
Component: Core
trunk
PC All
: P3 normal
Assigned To: amxmodx-bugs@alliedmods.net
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-26 05:19 PDT by schmurgel1983
Modified: 2013-05-26 10:53 PDT (History)
4 users (show)

See Also:


Attachments

Description schmurgel1983 2010-08-26 05:19:07 PDT
register_event("Damage", "damage_msg", "b", "2!0")

read_data(0)	byte	EventEntity
read_data(1)	byte	DamageSave
read_data(2)	byte	DamageTake
read_data(3)	long	DamageType
read_data(4)	coord	CoordX
read_data(5)	coord	CoordY
read_data(6)	coord	CoordZ

damage_type = read_data(3) is only 0

const DMG_HEGRENADE = (1<<24)
public damage_msg(id)
{
	new aid = get_user_attacker(id)
	new damage_type = read_data(3)
	
	if (damage_type & DMG_HEGRENADE)
		client_print(0, print_chat, "[HE] id: %i - aid: %i - rd2: %i - rd3: %i", id, aid, read_data(2), read_data(3))
	else
		client_print(0, print_chat, "[Bullet] id: %i - aid: %i - rd2: %i - rd3: %i", id, aid, read_data(2), read_data(3))
	
	return PLUGIN_CONTINUE
}
Comment 1 Reuben Morais 2010-12-20 14:35:05 PST
hmm, what?
Comment 2 Vincent Herbet [:Arkshine] 2010-12-21 20:04:41 PST
I think he says the param (3) damageType returns always 0, which is actually true.
Comment 3 schmurgel1983 2011-01-01 12:19:58 PST
read_data(3)    long    DamageType
yes param 3 is only 0
const DMG_HEGRENADE = (1<<24) // cs, cz
so u must use hamsandwich, to check if DMG_BULLET/DMG_BLAST/DMG_HEGRENADE,
can us fix it?
Comment 4 Vincent Herbet [:Arkshine] 2011-01-01 15:46:34 PST
I've not tried to check yet. But, yes, use instead Ham_TakeDamage which works fine.
Comment 5 Vincent Herbet [:Arkshine] 2013-05-26 10:53:20 PDT
There is no bug. DamageType passed through this message is only visual damage type, meaning that have hud art. You can check DMG_SHOWNHUD define in HLDSK.

Note You need to log in before you can comment on or make changes to this bug.