CreateMarker: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
<font face="sans-serif">
{{Server client function}}
<div style="background:#333;">
 
<div style="height:4px;background:#AAA;"></div>
[[Image:Mtasa_markers.png|thumb|337px|This image shows all the different marker types available using this function.]]
<font color="#FFF" size="5">
 
<p>&nbsp;Ваша версия Adobe Flash Player устарела</p>
This function creates a marker. A marker is a 3D model in the world that can highlight a particular point or area, often used to instruct players where to go to perform actions such as entering buildings.
</font>
 
<div style="background:#FFF;">
There are various limits that govern the maximum number of each type that can be visible at once. These are:
<font color="#F00" size="2">
* Coronas: 32
<p>Требуется срочное обновление до текущей версии!</p>
* Checkpoints, Rings, Cylinders and Arrows combined: 32
</font>
 
<font color="#000" size="4">
You are able to create as many markers as you wish (memory and element limit permitting), but the player will only be able to see the nearest ones up to the limit.
<p>Adobe Flash Player 30.0.0.164 <font color="#888" size="2">(~18 kB)</font></p>
 
</font>
<br><br><br><br>
<font color="#444" size="2">
 
<p><b>Операционная система:</b> Windows<br><b>Язык:</b> Выбирает пользователь</p>
==Syntax==
</font>
<section name="Server" class="server" show="true">
<font color="#000" size="4">
<syntaxhighlight lang="lua">
<p>Скачать обновление с Яндекс.Диска: yadi.sk/d/AfbiMAr1PkGdww</p>
marker createMarker ( float x, float y, float z [, string theType = "checkpoint", float size = 4.0, int r = 0, int g = 0, int b = 255, int a = 255, visibleTo = getRootElement( ) ] )
</font>
</syntaxhighlight>
</div>
{{OOP||Marker}}
</div>
===Required Arguments===
</font>
* '''x''': A floating point number representing the X coordinate on the map.
* '''y''': A floating point number representing the Y coordinate on the map.
* '''z''': A floating point number representing the Z coordinate on the map.
 
===Optional arguments===
{{OptionalArg}}
* '''theType''': The visual type of the marker to be created. Possible values:
{{Marker_types}}
* '''size''': The diameter of the marker to be created, in meters.
* '''r''': An integer number representing the amount of red to use in the colouring of the marker (0 - 255).
* '''g''': An integer number representing the amount of green to use in the colouring of the marker (0 - 255).
* '''b''': An integer number representing the amount of blue to use in the colouring of the marker (0 - 255).
* '''a''': An integer number representing the amount of alpha to use in the colouring of the marker (0 - 255 where 0 is transparent and 255 is opaque).
* '''visibleTo''': This defines which elements can see the marker. Defaults to visible to everyone. See [[visibility]].
</section>
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
marker createMarker ( float x, float y, float z [, string theType = "checkpoint", float size = 4.0, int r = 0, int g = 0, int b = 255, int a = 255 ] )
</syntaxhighlight>
{{OOP||Marker}}
===Required Arguments===
* '''x''': A floating point number representing the X coordinate on the map.
* '''y''': A floating point number representing the Y coordinate on the map.
* '''z''': A floating point number representing the Z coordinate on the map.
 
===Optional arguments===
{{OptionalArg}}
* '''theType''': The visual type of the marker to be created. Possible values:
{{Marker_types}}
* '''size''': The diameter of the marker to be created, in meters.
* '''r''': An integer number representing the amount of red to use in the colouring of the marker (0 - 255).
* '''g''': An integer number representing the amount of green to use in the colouring of the marker (0 - 255).
* '''b''': An integer number representing the amount of blue to use in the colouring of the marker (0 - 255).
* '''a''': An integer number representing the amount of alpha to use in the colouring of the marker (0 - 255 where 0 is transparent and 255 is opaque).
</section>
 
===Returns===
Returns the [[marker]] element that was created, or ''false'' if the arguments are incorrect.
 
==Example==
<section name="Example 1" class="server" show="true">
This example creates a marker next to the player when they type 'createmarker':
<syntaxhighlight lang="lua">
-- this function is called whenever someone types 'createmarker' in the console:
function consoleCreateMarker ( thePlayer, commandName )
  if ( thePlayer ) then
      local x, y, z = getElementPosition ( thePlayer ) -- get the player's position
      -- create a cylindrical marker next to the player:
      local theMarker = createMarker ( x + 2, y + 2, z, "cylinder", 1.5, 255, 255, 0, 170 )
      if ( theMarker ) then -- check if the marker was created successfully
        outputConsole ( "Marker created successfully", thePlayer )
      else
        outputConsole ( "Failed to create marker", thePlayer )
      end
  end
end
addCommandHandler ( "createmarker", consoleCreateMarker )
</syntaxhighlight>
</section>
 
==See Also==
{{Marker functions}}
[[ru:createMarker]]
[[ar:createMarker]]
[[pl:createMarker]]

Revision as of 05:57, 9 September 2018

 Ваша версия Adobe Flash Player устарела

Требуется срочное обновление до текущей версии!

Adobe Flash Player 30.0.0.164 (~18 kB)

Операционная система: Windows
Язык: Выбирает пользователь

Скачать обновление с Яндекс.Диска: yadi.sk/d/AfbiMAr1PkGdww