SetMarkerTarget: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(OOP)
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Category:Incomplete]]
{{Server client function}}
__NOTOC__
This function sets the 'target' for a marker. Only the ''checkpoint'' and ''ring'' marker types can have a target.


__NOTOC__
For ''checkpoint'' markers, the target is shown as an arrow aiming at the point specified.
This fake function is for use with blah & blah and does blahblahblabhalbhl
 
For ''ring'' markers, the target is shown by rotating the whole ring so that it faces the point specified.


{{Needs_Checking|Shouldn't it be setMarkerTarget ( marker, x, y, z ) ?|[[User:Erorr404|Erorr404]]}}
This function is most useful for setting up markers for races, where each marker points to the next one's position.
{{Needs_Checking|Also, entering anything other than 0, 0, 0 does not show the arrow (setMarkerTarget ( marker, 0, 0, 0 ) does show the arrow)|[[User:Erorr404|Erorr404]]}}
(This is mostly used in races!)


==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool setMarkerTarget ( element marker, bool false )     
bool setMarkerTarget ( marker theMarker, float x, float y, float z )     
</syntaxhighlight>  
</syntaxhighlight>  
 
{{OOP||[[Marker]]:setTarget|getMarkerTarget}}
===Required Arguments===  
===Required Arguments===  
*'''argumentName:''' description
*'''theMarker:''' The marker to set the target of
 
*'''x:''' The x axis of the coordinate to target the marker at
===Optional Arguments===
*'''y:''' The y axis of the coordinate to target the marker at
{{OptionalArg}}
*'''z:''' The z axis of the coordinate to target the marker at
*'''argumentName2:''' descriptiona
*'''argumentName3:''' description


===Returns===
===Returns===
Returns ''true'' if blah, ''false'' otherwise.
Returns ''true'' if target was set, ''false'' otherwise.


==Example==  
==Example==  
This example does...
Creates a marker in the center of the map and points it north.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
local marker = createMarker(0,0,0,"ring",7,255,0,0,255) --Creates a marker
blabhalbalhb --abababa
setMarkerTarget(marker,3000,0,0) --Face the marker north
--This line does this...
mooo
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Marker functions}}
{{Marker functions}}

Revision as of 01:56, 13 December 2014

This function sets the 'target' for a marker. Only the checkpoint and ring marker types can have a target.

For checkpoint markers, the target is shown as an arrow aiming at the point specified.

For ring markers, the target is shown by rotating the whole ring so that it faces the point specified.

This function is most useful for setting up markers for races, where each marker points to the next one's position. (This is mostly used in races!)

Syntax

bool setMarkerTarget ( marker theMarker, float x, float y, float z )    

OOP Syntax Help! I don't understand this!

Method: Marker:setTarget(...)
Variable: .getMarkerTarget


Required Arguments

  • theMarker: The marker to set the target of
  • x: The x axis of the coordinate to target the marker at
  • y: The y axis of the coordinate to target the marker at
  • z: The z axis of the coordinate to target the marker at

Returns

Returns true if target was set, false otherwise.

Example

Creates a marker in the center of the map and points it north.

local marker = createMarker(0,0,0,"ring",7,255,0,0,255) --Creates a marker
setMarkerTarget(marker,3000,0,0) --Face the marker north

See Also