031D

From GTAMods Wiki
Revision as of 07:52, 31 December 2014 by Spaceeinstein (talk | contribs) (page updates + values named)
Jump to navigation Jump to search

GTA III Vice City San Andreas HAS_CHAR_BEEN_DAMAGED_BY_WEAPON


Description

Checks if the character has been damaged by the specified weapon type

Syntax

031D:   actor [char handle] hit_by_weapon [int]

Parameter

[char handle]
The handle of the character
[int]
Weapon type (see this in addition to below)

Native analog

HAS_CHAR_BEEN_DAMAGED_BY_WEAPON

This conditional opcode returns true if the character has been damaged by the specific weapon or environment. The last damage done to the character can be cleared using opcode 0467. Weapon numbers for projectiles do not get recognized so other values have to be used. Values outside the range of weapon numbers are supported for a variety of environmental damage.

Vice City:

Type Enum Notes
31 WEAPONTYPE_FLAMETHROWER fire, not just Flamethrower
39 WEAPONTYPE_RAMMEDBYCAR helicopter blades
40 WEAPONTYPE_RUNOVERBYCAR vehicle collision
41 WEAPONTYPE_EXPLOSION explosion
42 WEAPONTYPE_UZI_DRIVEBY drive-by
43 WEAPONTYPE_DROWNING water
44 WEAPONTYPE_FALL ground collision
46 WEAPONTYPE_ANYMELEE any melee
47 WEAPONTYPE_ANYWEAPON any weapons (melee, fire, gun, explosion)