Damage Types: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
(One intermediate revision by the same user not shown)
Line 1: Line 1:
The following death reasons are used by event like onPlayerWasted for the killerWeapon argument to describe the reason, why a ped died.<br>
The following damage types are used by events like [[onPlayerDamage]] or [[onPlayerWasted]] for the '''weapon''' argument to describe the reason, why a [[ped]] has been damaged or died.<br>
When a player was shot by a weapon, the respective weapon ID is the death reason ID. The weapon IDs can be found [[Weapons|here]].
When a player was shot by a weapon, the respective weapon ID is the damage type ID. The weapon IDs can be found [[Weapons|here]].
<br>
<br>
<br>
<br>
Line 6: Line 6:
|-
|-
!ID
!ID
! class="unsortable" |Death reason
! class="unsortable" |Damage type
! class="unsortable" |Additional info
! class="unsortable" |Additional info
|-
|-
!19
!19
|Rocket
|Rocket
|Actual death reason / weapon ID when dying from a rocket launcher
|Actual damage type when damaged from a rocket launcher
|-
|-
!37
!37
|Burnt
|Burnt
|This is used by a death by fire, even when the fire is created by a rocket explosion or a molotov
|This is used by a damage by fire, even when the fire is created by a rocket explosion or a molotov
|-
|-
!49
!49
Line 23: Line 23:
!50
!50
|Ranover
|Ranover
|This is also called when dying because of helicopter blades
|This is also called when damaged because of helicopter blades
|-
|-
!51
!51
|Explosion
|Explosion
|This may sometimes also be used at an indirect death through an exploding rocket
|This may sometimes also be used at an indirect damage through an exploding rocket
|-
|-
!52
!52
Line 43: Line 43:
!55
!55
|Unknown
|Unknown
|No known information about this death reason
|No known information about this damage type
|-
|-
!56
!56
|Melee
|Melee
|Seems to be never called (?); for an actual melee death, the fist weapon ID (0) is used (see [[Weapons|here]])
|Seems to be never called (?); for an actual melee damage, the fist weapon ID (0) is used (see [[Weapons|here]])
|-
|-
!57
!57
Line 59: Line 59:
!63
!63
|Blown
|Blown
|Actual death reason when dying in a vehicle explosion
|Actual damage type when dying in a vehicle explosion
|-
|-
|}
|}


Death Reasons in lua table
Damage Types in lua table
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
local deathReasons = {
local damageTypes = {
[19] = "Rocket",
[19] = "Rocket",
[37] = "Burnt",
[37] = "Burnt",

Revision as of 15:12, 17 January 2017

The following damage types are used by events like onPlayerDamage or onPlayerWasted for the weapon argument to describe the reason, why a ped has been damaged or died.
When a player was shot by a weapon, the respective weapon ID is the damage type ID. The weapon IDs can be found here.

ID Damage type Additional info
19 Rocket Actual damage type when damaged from a rocket launcher
37 Burnt This is used by a damage by fire, even when the fire is created by a rocket explosion or a molotov
49 Rammed
50 Ranover This is also called when damaged because of helicopter blades
51 Explosion This may sometimes also be used at an indirect damage through an exploding rocket
52 Driveby This is NOT used for a driveby kill with e.g. the 'realdriveby' resource
53 Drowned
54 Fall
55 Unknown No known information about this damage type
56 Melee Seems to be never called (?); for an actual melee damage, the fist weapon ID (0) is used (see here)
57 Weapon Seems to be never called (?)
59 Tank Grenade
63 Blown Actual damage type when dying in a vehicle explosion

Damage Types in lua table

local damageTypes = {
	[19] = "Rocket",
	[37] = "Burnt",
	[49] = "Rammed",
	[50] = "Ranover/Helicopter Blades",
	[51] = "Explosion",
	[52] = "Driveby",
	[53] = "Drowned",
	[54] = "Fall",
	[55] = "Unknown",
	[56] = "Melee",
	[57] = "Weapon",
	[59] = "Tank Grenade",
	[63] = "Blown"
}