SendShotInfo: Difference between revisions
No edit summary |
No edit summary |
||
(7 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
params=<syntaxhighlight lang="lua">( bodypartId, animationId, autodeath=false, autodeathweapon=0, autodeathkiller=255 )</syntaxhighlight> | params=<syntaxhighlight lang="lua">( bodypartId, animationId, autodeath=false, autodeathweapon=0, autodeathkiller=255 )</syntaxhighlight> | ||
<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. In latter case, animation ID from the following table will be used: | ||
{{{!}} 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]]. | ::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) | ::autodeathweapon : The ID of the weapon with which npc was killed.(Use 70 for suicide) | ||
Line 15: | Line 41: | ||
SetTimerEx( "SendDeathInfo", 2000, 1, 27, 0, 6 );</source> | SetTimerEx( "SendDeathInfo", 2000, 1, 27, 0, 6 );</source> | ||
If player with ID <source inline>1</source> shot down npc with Ruger in head<source inline>26</source>: | If player with ID <source inline>1</source> shot down npc with Ruger in head<source inline>26</source>: | ||
<source lang="lua">SendShotInfo(BODYPART_HEAD,17,true,26, 1);</source> See [http://wiki.thijn.ovh/index.php?title=Animations this] page for animation IDs. Thanks to thijn for website| | <source lang="lua">SendShotInfo(BODYPART_HEAD,17,true,26, 1);</source> | ||
<source lang="lua">SendShotInfo(BODYPART_HEAD,null,true,26, 1); //same. using null will select animation automatically.</source> | |||
See [http://wiki.thijn.ovh/index.php?title=Animations this] page for animation IDs. Thanks to thijn for website| | |||
relfuncs=*[[SendDeathInfo]] | relfuncs=*[[SendDeathInfo]] | ||
}} | }} |
Latest revision as of 16:15, 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. In latter case, animation ID from the following table will be used:
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.