OnClientPlayerStealthKill: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Adding some indentation to Castillo's basic example.)
m (Improving)
Line 19: Line 19:
This example disables stealth kills.
This example disables stealth kills.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
addEventHandler("onClientPlayerStealthKill",getLocalPlayer(),
function abortAllStealthKills(targetPlayer)
    function (targetPlayer)
     cancelEvent()
     cancelEvent()
end)
end
addEventHandler("onClientPlayerStealthKill", getLocalPlayer(), abortAllStealthKills)
</syntaxhighlight>
</syntaxhighlight>



Revision as of 17:03, 19 May 2011

This event is triggered when a player stealth kills another player.

Parameters

element targetPlayer
  • targetPlayer: The player or ped that is being stealth killed.

Source

The source of this event is the player that initiated the stealth kill.

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)

See Also

Client player events


Client event functions