SendShotInfo: Difference between revisions
No edit summary |
No edit summary |
||
Line 7: | Line 7: | ||
<poem>::bodypartId : The [[bodypart]] which 'was' hit. | <poem>::bodypartId : The [[bodypart]] which 'was' hit. | ||
::animationId : The same as the animation ID used in server side OR null to automatically select an animation. | ::animationId : The same as the animation ID used in server side OR null to automatically select an animation. | ||
::{{{!}} class="wikitable" | ::animation ID used when '''null''' is provided{{{!}} class="wikitable" | ||
{{!}}- | {{!}}- | ||
! bodyPart | ! bodyPart |
Revision as of 16:13, 11 February 2024
The parameters autodeath, autodeathweapon, autodeathkiller were added in v1.8 beta and will not work in previous versions. The use of null in parameter animation was also added in the same version.
Description:
This function registers to server that the npc is shot down ( by another player ). This function is followed by SendDeathInfo after a delay (must be called after say 1000 ms ) if autodeath parameters are not used.
Parameters:
( bodypartId, animationId, autodeath=false, autodeathweapon=0, autodeathkiller=255 )
bodypartId : The bodypart which 'was' hit.
animationId : The same as the animation ID used in server side OR null to automatically select an animation.
animation ID used when null is provided{| class="wikitable"
|-
! bodyPart
! Animation
|-
| 0
| 13
|-
| 1
| 18
|-
| 2
| 19
|-
| 3
| 20
|-
| 4
| 21
|-
| 5
| 22
|-
| 6
| 17
|}
autodeath : If true, npc registers death by itself eliminating need to call SendDeathInfo.
autodeathweapon : The ID of the weapon with which npc was killed.(Use 70 for suicide)
autodeathkiller : The ID of the killer who killed npc. (255 if npc died itself)
Return Values:
This function does not return any specific values.
Example
SendShotInfo( 6, 17 ); //6 means head and 17 means shot in face. SetTimerEx( "SendDeathInfo", 2000, 1, 27, 0, 6 );
If player with ID 1
shot down npc with Ruger in head26
:
SendShotInfo(BODYPART_HEAD,17,true,26, 1);
SendShotInfo(BODYPART_HEAD,null,true,26, 1); //same. using null will select animation automatically.
See this page for animation IDs. Thanks to thijn for website
Related Functions
The following functions may be helpful as they relate to this function in one way or another.