LibAction: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
1. '''OnTargetCleared'''<source lang="lua"> | 1. '''OnTargetCleared'''<source lang="lua"> | ||
OnTargetCleared([integer]targetpid, [integer]reason)</source> | OnTargetCleared([integer]targetpid, [integer]reason)</source> | ||
The value of reason can be: | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- |
Revision as of 04:17, 20 February 2023
Callbacks
1. OnTargetCleared
OnTargetCleared([integer]targetpid, [integer]reason)
The value of reason can be:
Constant |
---|
AMMO_SHORTAGE |
PLAYER_STREAMEDOUT |
INSTRUCTION_RECEIVED |
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()