OnClientPlayerTarget: Difference between revisions
Jump to navigation
Jump to search
(8 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{ | __NOTOC__ | ||
{{Client event}} | |||
This event is triggered whenever the local player targets an element. | |||
==Parameters== | |||
== | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
element target | |||
</syntaxhighlight> | </syntaxhighlight> | ||
*'''target:''' The element the player targetted. | |||
==Source== | |||
The [[event system#Event source|source]] of this event is the [[player]] that targeted the element. | |||
==Example== | ==Example== | ||
Line 22: | Line 17: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function targetingActivated ( target ) | function targetingActivated ( target ) | ||
if ( target ) then | if ( target ) then | ||
outputChatBox(tostring(getElementType(target))) | |||
end | end | ||
end | end | ||
addEventHandler ( "onClientPlayerTarget", getRootElement(), targetingActivated ) | addEventHandler ( "onClientPlayerTarget", getRootElement(), targetingActivated ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | |||
===Client player events=== | |||
{{Client_player_events}} | |||
===Client event functions=== | |||
{{Client_event_functions}} |
Latest revision as of 00:06, 2 June 2013
This event is triggered whenever the local player targets an element.
Parameters
element target
- target: The element the player targetted.
Source
The source of this event is the player that targeted the element.
Example
This example outputs the type of the target the client is aiming at
function targetingActivated ( target ) if ( target ) then outputChatBox(tostring(getElementType(target))) end end addEventHandler ( "onClientPlayerTarget", getRootElement(), targetingActivated )
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