LibAction: 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:
2. '''OnTargetOutOfRange'''
2. '''OnTargetOutOfRange'''
<source lang="lua">OnTargetOutOfRange([integer]targetid)</source>
<source lang="lua">OnTargetOutOfRange([integer]targetid)</source>
Called when target is out of range of the weaponrange of the current weapon of npc. If target is not cleared, npc resumes shooting when target comes in range again.   
<poem>Called when target is out of range of the weaponrange of the current weapon of npc. If target is not cleared, npc resumes shooting when target comes in range again.   
</poem>
3. '''OnPullingTrigger'''
3. '''OnPullingTrigger'''
<source lang="lua">
<source lang="lua">

Revision as of 04:11, 20 February 2023

Callbacks

1. OnTargetCleared

OnTargetCleared([integer]targetpid, [integer]reason)

2. OnTargetOutOfRange

OnTargetOutOfRange([integer]targetid)

Called when target is out of range of the weaponrange of the current weapon of npc. If target is not cleared, npc resumes shooting when target comes in range again.

3. OnPullingTrigger

OnPullingTrigger([integer] keys, [Vector]pos,  [float]angle, [integer]health, [integer]armour, [integer]weapon, [integer]ammo, [Vector]speed, [Vector]aimpos, [Vector]aimdir, [bool]isCrouching, [bool]isReloading )

Functions ShootTarget(playerid) ClearTarget() GetTarget()