Difference between revisions of "SendDamageToEntity"
From Nomad DB
Wasdennnoch (talk | contribs) (Created page with "Sends a damage event to the specified Pawn. == Syntax == <syntaxhighlight lang="lua"> SendDamageToEntity(targetPawnId, sourceEntityId, damageType, damageAmount, damageLocatio...") |
m |
||
Line 1: | Line 1: | ||
− | Sends a damage event to the specified Pawn. | + | Sends a damage event to the specified [[Pawn|pawn]]. |
== Syntax == | == Syntax == | ||
Line 5: | Line 5: | ||
SendDamageToEntity(targetPawnId, sourceEntityId, damageType, damageAmount, damageLocation) | SendDamageToEntity(targetPawnId, sourceEntityId, damageType, damageAmount, damageLocation) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | * '''targetPawnId''' (string): [[EntityId|ID]] of the [[Pawn]] to be damaged | + | * '''targetPawnId''' (string): [[EntityId|ID]] of the [[Pawn|pawn]] to be damaged |
− | * '''sourceEntityId''' (string): [[EntityId|ID]] of the | + | * '''sourceEntityId''' (string): [[EntityId|ID]] of the entity the damage should logically come from |
* '''damageType''' (int): [[#Damage Types|Type]] of damage to send | * '''damageType''' (int): [[#Damage Types|Type]] of damage to send | ||
* '''damageAmount''' (float): Amount of damage to send | * '''damageAmount''' (float): Amount of damage to send |
Revision as of 15:47, 15 April 2020
Sends a damage event to the specified pawn.
Syntax
SendDamageToEntity(targetPawnId, sourceEntityId, damageType, damageAmount, damageLocation)
- targetPawnId (string): ID of the pawn to be damaged
- sourceEntityId (string): ID of the entity the damage should logically come from
- damageType (int): Type of damage to send
- damageAmount (float): Amount of damage to send
- damageLocation (int): Part of the body the pawn should be damaged at (see #Damage Locations)
Example
Causes the player to send himself bullet damage.
SendDamageToEntity(GetLocalPlayerEntityId(), GetLocalPlayerEntityId(), 3, 100, 512)
Parameters
Damage Types
ID | Type |
---|---|
3 | Bullet |
4 | Explosion |
5 | Cut |
7 | Burn |
16 | Instant Kill |
Damage Locations
ID | Location |
---|---|
1 | Torso |
2 | Pelvis |
4 | Shoulders |
8 | Left upper arm |
16 | Left forearm |
32 | Left hand |
64 | Right upper arm |
128 | Right forearm |
256 | Right hand |
512 | Head |
1024 | Left leg |
2048 | Left foot |
4096 | Right leg |
8192 | Right foot |