OnClientPlayerTarget: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{Needs_Checking|Could not make work with
<pre>root = getRootElement ()
addEventHandler ( "onClientPlayerTarget", root, "targetingActivated" )
function targetingActivated ( target )
outputChatBox ( "hi" )
end</pre>
and yes it was defined as a client script. --[[User:Ransom|Ransom]] 00:34, 12 April 2007 (CDT)}}
[[Category:Incomplete Event]]
[[Category:Incomplete Event]]


__NOTOC__  
__NOTOC__  
This event is blahblah and is used for blahblah.
This event is triggerd every time a player is aiming (requiers a gun)


==Syntax==  
==Syntax==  

Revision as of 16:26, 14 September 2007


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

Syntax

void onClientPlayerTarget ( element target )

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 )