OnClientPlayerTarget: Difference between revisions
Jump to navigation
Jump to search
Line 16: | Line 16: | ||
This example outputs the type of the target the client is aiming at | This example outputs the type of the target the client is aiming at | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function targetingActivated ( | function targetingActivated ( MOJRM-511 ) | ||
if ( | if ( MOJRM-511 ) then | ||
outputChatBox(tostring(getElementType( | outputChatBox(tostring(getElementType(MOJRM-511))) | ||
end | end | ||
end | end |
Revision as of 23:27, 1 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 ( MOJRM-511 ) if ( MOJRM-511 ) then outputChatBox(tostring(getElementType(MOJRM-511))) 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