OnClientPlayerTarget: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 19: Line 19:


==Example==  
==Example==  
This example does...
This example outputs the type of the target the client is aiming at
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
function targetingActivated ( target )
blabhalbalhb --abababa
if ( target ) then
--This line does this...
outputChatBox(tostring(getElementType(source)))
mooo
end
end
addEventHandler ( "onClientPlayerTarget", getRootElement(), targetingActivated )
</syntaxhighlight>
</syntaxhighlight>

Revision as of 16:22, 14 September 2007

Dialog-information.png This article needs checking.

Reason(s): Could not make work with
root = getRootElement ()

addEventHandler ( "onClientPlayerTarget", root, "targetingActivated" )
function targetingActivated ( target )
outputChatBox ( "hi" )
end

and yes it was defined as a client script. --Ransom 00:34, 12 April 2007 (CDT)


This event is blahblah and is used for blahblah.

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 )