OnClientPlayerTarget: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 7: Line 7:
void onClientPlayerTarget ( element target )
void onClientPlayerTarget ( element target )
</syntaxhighlight>  
</syntaxhighlight>  
===Required Arguments===
*'''target:''' The element the player is currently targeting.


==Example==  
==Example==  

Revision as of 16:33, 14 September 2007


This event is triggerd every time a player is aiming (requiers a gun)

Syntax

void onClientPlayerTarget ( element target )

Required Arguments

  • target: The element the player is currently targeting.

Example

This example outputs the type of the target the client is aiming at

function targetingActivated ( target )
if ( target ) then
	outputChatBox(tostring(getElementType(source)))
end
end
addEventHandler ( "onClientPlayerTarget", getRootElement(), targetingActivated )