OnClientPlayerStealthKill: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 23: | Line 23: | ||
end | end | ||
addEventHandler("onClientPlayerStealthKill", getLocalPlayer(), abortAllStealthKills) | addEventHandler("onClientPlayerStealthKill", getLocalPlayer(), abortAllStealthKills) | ||
</syntaxhighlight> | |||
This example disables stealth kills on a specific Ped. | |||
<syntaxhighlight lang="lua"> | |||
local myNPC = createPed (187, 1481.265, -1752.25, 15.446, 0) | |||
function antiKnife (target) | |||
if target == myNPC then | |||
cancelEvent() | |||
end | |||
end | |||
addEventHandler("onClientPlayerStealthKill", getLocalPlayer(), antiKnife) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 17:08, 5 February 2018
This event is triggered when the local player stealth kills another player.
Parameters
element targetPlayer
Source
The source of this event is the player that initiated the stealth kill. (Local player only)
Cancel effect
If this event is canceled, then the stealth kill is aborted.
Example
This example disables stealth kills.
function abortAllStealthKills(targetPlayer) cancelEvent() end addEventHandler("onClientPlayerStealthKill", getLocalPlayer(), abortAllStealthKills)
This example disables stealth kills on a specific Ped.
local myNPC = createPed (187, 1481.265, -1752.25, 15.446, 0) function antiKnife (target) if target == myNPC then cancelEvent() end end addEventHandler("onClientPlayerStealthKill", getLocalPlayer(), antiKnife)
See Also
Client player events
- onClientPlayerChangeNick
- onClientPlayerChoke
- onClientPlayerDamage
- onClientPlayerHeliKilled
- onClientPlayerHitByWaterCannon
- onClientPlayerJoin
- onClientPlayerPickupHit
- onClientPlayerPickupLeave
- onClientPlayerQuit
- onClientPlayerRadioSwitch
- onClientPlayerSpawn
- onClientPlayerStealthKill
- onClientPlayerStuntFinish
- onClientPlayerStuntStart
- onClientPlayerTarget
- onClientPlayerVehicleEnter
- onClientPlayerVehicleExit
- onClientPlayerVoicePause
- onClientPlayerVoiceResumed
- onClientPlayerVoiceStart
- onClientPlayerVoiceStop
- onClientPlayerWasted
- onClientPlayerWeaponFire
- onClientPlayerWeaponSwitch
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled