SetMarkerTarget: Difference between revisions

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


This function is most useful for setting up markers for races, where each marker points to the next one's position.
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==  
==Syntax==  
Line 24: Line 25:


==Example==  
==Example==  
 
<section name="Example 1" class="both" show="true">
Creates a marker in the center of the map and points it north.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
 
local marker = createMarker(0,0,0,"ring",7,255,0,0,255,root) --Creates a marker
setMarkerTarget(marker,3000,0,0) --Face the marker north
</syntaxhighlight>
</syntaxhighlight>
</section>


==See Also==
==See Also==
{{Marker functions}}
{{Marker functions}}
[[Category:Needs Example]]
[[Category:Needs Example]]

Revision as of 19:33, 11 December 2012

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 )    

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

Click to collapse [-]
Example 1

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,root) --Creates a marker
setMarkerTarget(marker,3000,0,0) --Face the marker north

See Also