onClientPlayerTarget | Multi Theft Auto: Wiki Skip to content

onClientPlayerTarget

Client-side
Server-side
Shared

This event is triggered whenever the local player targets an element.

Parameters

element target
  • target: The element the player targetted.

Source

element: The source of this event is the player that targeted the element.

Code Examples

client

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