CreateBlip: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
<font face="sans-serif">
{{Server client function}}
<div style="background:#333;">
This function creates a [[blip]] [[element]], which is displayed as an icon on the client's radar.
<div style="height:4px;background:#AAA;"></div>
 
<font color="#FFF" size="5">
==Syntax==
<p>&nbsp;Ваша версия Adobe Flash Player устарела</p>
<section name="Server" class="server" show="true">
</font>
<syntaxhighlight lang="lua">
<div style="background:#FFF;">
blip createBlip ( float x, float y, float z [, int icon = 0, int size = 2, int r = 255, int g = 0, int b = 0, int a = 255, int ordering = 0, float visibleDistance = 16383.0, visibleTo = getRootElement( ) ] )
<font color="#F00" size="2">
</syntaxhighlight>
<p>Требуется срочное обновление до текущей версии!</p>
</section>
</font>
<section name="Client" class="client" show="true">
<font color="#000" size="4">
<syntaxhighlight lang="lua">
<p>Adobe Flash Player 30.0.0.164 <font color="#888" size="2">(~18 kB)</font></p>
blip createBlip ( float x, float y, float z [, int icon = 0, int size = 2, int r = 255, int g = 0, int b = 0, int a = 255, int ordering = 0, float visibleDistance = 16383.0 ] )
</font>
</syntaxhighlight>  
<font color="#444" size="2">
</section>
<p><b>Операционная система:</b> Windows<br><b>Язык:</b> Выбирает пользователь</p>
{{OOP||[[Blip]]}}
</font>
===Required Arguments===  
<font color="#000" size="4">
*'''x:''' The x position of the blip, in world coordinates.
<p>Скачать обновление с Яндекс.Диска: yadi.sk/d/AfbiMAr1PkGdww</p>
*'''y:''' The y position of the blip, in world coordinates.
</font>
*'''z:''' The z position of the blip, in world coordinates.
</div>
 
</div>
===Optional Arguments===
</font>
{{OptionalArg}}
*'''icon:''' The icon that the radar blips should be. Valid values can be seen at [[Blip Icons]]
*'''size:''' The size of the radar blip. Only applicable to the ''Marker'' icon. Default is 2. Maximum is 25.
*'''r:''' The amount of red in the blip's color (0 - 255). Only applicable to the ''Marker'' icon. Default is 255.
*'''g:''' The amount of green in the blip's color (0 - 255). Only applicable to the ''Marker'' icon. Default is 0.
*'''b:''' The amount of blue in the blip's color (0 - 255). Only applicable to the ''Marker'' icon. Default is 0.
*'''a:''' The amount of alpha in the blip's color (0 - 255). Only applicable to the ''Marker'' icon. Default is 255.
{{New feature/item|3|1.0||
*'''ordering:''' This defines the blip's Z-level ordering (-32768 - 32767). Default is 0.
*'''visibleDistance:''' The maximum distance from the camera at which the blip is still visible (0-65535)
}}
<section name="Server" class="server" show="true">
*'''visibleTo:''' This defines which elements can see the blip. Defaults to visible to everyone. See [[visibility]].
</section>
 
==Returns==
Returns an [[element]] of the [[blip]] if it was created successfully, ''false'' otherwise.
 
==Example==
<section name="Server" class="server" show="true">
'''Example 1:''' This example creates a radar blip at a random player's position and makes it so that it is only visible to that player.
<syntaxhighlight lang="lua">
-- Pick a random player
local myPlayer = getRandomPlayer( )
-- Retrieve the player's position and store it in the variables x, y and z
local x, y, z = getElementPosition( myPlayer )
-- Create a radar blip at the player's position, with a 'cash' icon and only visible to the player
local myBlip = createBlip( x, y, z, 51, 0, 0, 0, 255, myPlayer )
</syntaxhighlight>
 
'''Example 2:''' This example attaches a blip to a player. You can attach a blip to an element by just setting the blip's parent to that element.
<syntaxhighlight lang="lua">
-- Pick a random player
local myPlayer = getRandomPlayer( )
-- Create a radar blip in the middle of the map
local myBlip = createBlip( 0, 0, 0 )
-- Make the player the parent of the blip, so that the blip follows the player around
setElementParent( myBlip, myPlayer )
</syntaxhighlight>
</section>
 
==See Also==
{{Blip_functions}}
 
[[HU:createBlip]]
[[AR:createBlip]]
[[es:createBlip]]
[[DE:createBlip]]
[[PL:createBlip]]

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