Difference between revisions of "031D"

From GTAMods Wiki
Jump to navigation Jump to search
(weapon types)
(page updates + values named)
Line 1: Line 1:
{{OpCode
+
{{Icon|trilogy}} '''HAS_CHAR_BEEN_DAMAGED_BY_WEAPON'''
| ini        = 031D=2,  %1d% %2d%
+
<hr />
| description = Checks if the character has been damaged by the specified weapon
+
'''Description'''
| p1          = Character handle
+
: Checks if the character has been damaged by the specified weapon type
| p2          = [[Weapon#Lists of Weapons|Weapon number]]
+
'''Syntax'''
| game        = [[GTA 3]], [[Vice City]], [[San Andreas]]
+
: 031D: &nbsp; actor [''char handle''] hit_by_weapon [''int'']
| native      = [[HAS_CHAR_BEEN_DAMAGED_BY_WEAPON]]
+
'''Parameter'''
}}
+
: [''char handle'']
This conditional opcode returns true if the character has been damaged by the specific weapon. The last damage done to the character can be cleared using opcode [[0467]]. Weapon numbers for projectiles do not get recognized so other values has to be used. Values outside the range of weapon numbers are supported for a variety of environmental damage.
+
:: The handle of the character
 +
: [''int'']
 +
:: Weapon type (see [[Weapon#Lists of Weapons|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:
 
Vice City:
* 31 - fire
+
{| class="wikitable"
* 39 - heli blades
+
! Type || Enum || Notes
* 40 - vehicle collision
+
|-
* 41 - explosion
+
| 31 || WEAPONTYPE_FLAMETHROWER || fire, not just Flamethrower
* 42 - drive-by
+
|-
* 43 - water
+
| 39 || WEAPONTYPE_RAMMEDBYCAR || helicopter blades
* 44 - ground collision
+
|-
* 47 - any player's weapon
+
| 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)
 +
|}
 +
 
 +
[[Category:OpCodes]]

Revision as of 07:52, 31 December 2014

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)