SendDeathInfo: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 4: Line 4:
<poem>::weaponId : The same as weapon IDs on server side.  
<poem>::weaponId : The same as weapon IDs on server side.  
::killerId : The ID of the killer who 'killed' the npc.
::killerId : The ID of the killer who 'killed' the npc.
::bodypartId : The [[bodypart]] the npc was hit.</poem>|
::bodypartId : The [[bodypart]] the npc was hit.
SendDeathInfo must be preceded by a call to SendShotInfo for the animation of npc falling down etc. SendDeathInfo removes body and call onPlayerDeath/onPlayerKill serverside.</poem>|
retvals=This function does not return any specific values.|
retvals=This function does not return any specific values.|
example=<source lang="lua">
example=<source lang="lua">
function ICantTakeItAnyMore
function ICantTakeItAnyMore
{
{
SendDeathInfo( 70, 255, 0 );  
    SendShotInfo(0, 0xd);
    SetTimerEx("SendDeathInfo", 2000, 1, 70, 255, 0 );  
}
}
</source>|
</source>|
relfuncs=*[[SendShotInfo]]
relfuncs=*[[SendShotInfo]]
*[[SetTimerEx]]
}}
}}

Latest revision as of 09:32, 3 February 2023


Description:
This sends packet to server so that server treats npc as killed ( by a player ) and shows the death message.


Parameters:

( weaponId, killerId, bodypartId )

weaponId : The same as weapon IDs on server side.
killerId : The ID of the killer who 'killed' the npc.
bodypartId : The bodypart the npc was hit.
SendDeathInfo must be preceded by a call to SendShotInfo for the animation of npc falling down etc. SendDeathInfo removes body and call onPlayerDeath/onPlayerKill serverside.


Return Values:
This function does not return any specific values.


Example

function ICantTakeItAnyMore
{
	
    SendShotInfo(0, 0xd); 
    SetTimerEx("SendDeathInfo", 2000, 1, 70, 255, 0 ); 
}

Related Functions

The following functions may be helpful as they relate to this function in one way or another.