SendShotInfo

From NPC for VCMP 0.4 Servers
Revision as of 17:59, 8 February 2024 by Habi (talk | contribs)
Jump to navigation Jump to search

The parameters autodeath, autodeathweapon, autodeathkiller were added in v1.8 beta and will not work in previous versions.


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.
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);

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.