PL/GetMarkerType: Difference between revisions
Jump to navigation
Jump to search
(Created page with "W trakcie tłumaczenia - neQ.") |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | |||
{{Server client function}} | |||
Funkcja ta zwraca typ markera. | |||
==Składnia funkcji== | |||
<syntaxhighlight lang="lua">string getMarkerType ( marker theMarker )</syntaxhighlight> | |||
{{OOP||[[Marker]]:getMarkerType|markerType|setMarkerType}} | |||
===Required Arguments=== | |||
* '''theMarker''': Element markera którego chcemy sprawdzić typ. | |||
===Returns=== | |||
* Zwraca jeden z podanych niżej typów markera. | |||
{{Marker_types}} | |||
Jeśli podany jest zły element, funkcja zwraca fałsz. | |||
==Przykład== | |||
<section name="Client and server" class="both" show="true"> | |||
This function creates a default marker at a given position and outputs its type. | |||
<syntaxhighlight lang="lua"> | |||
function createMarkerAndOutputType ( x, y, z ) | |||
-- we create the marker | |||
local theMarker = createMarker ( x, y, z ) | |||
-- if the marker was created, | |||
if ( theMarker ) then | |||
-- then get its type, | |||
local markerType = getMarkerType ( theMarker ) | |||
-- and output it. | |||
outputChatBox ( "It's a " .. markerType .. " marker!" ) | |||
end | |||
-- return the created marker element (or false) where this function was called | |||
return theMarker | |||
end | |||
</syntaxhighlight> </section> | |||
==Zobacz także== | |||
{{Marker Functions}} |
Revision as of 13:12, 3 August 2017
Funkcja ta zwraca typ markera.
Składnia funkcji
string getMarkerType ( marker theMarker )
OOP Syntax Help! I don't understand this!
- Method: Marker:getMarkerType(...)
- Variable: .markerType
- Counterpart: setMarkerType
Required Arguments
- theMarker: Element markera którego chcemy sprawdzić typ.
Returns
- Zwraca jeden z podanych niżej typów markera.
- "checkpoint": A race checkpoint. These are very tall, but not infinite, light pillars. Checkpoints snap to ground and become invisible after going over a certain Z height.
- "ring": Doughnut shaped ring, normally used for aircraft.
- "cylinder": Small glowing ground ring. These are the glow markers you walk into to activate missions or events in single player.
- "arrow": Arrow pointing down. These are the arrows on the doors you can enter in single player, except MTA's are not animated by default.
- "corona": A glowing ball of light.
Jeśli podany jest zły element, funkcja zwraca fałsz.
Przykład
Click to collapse [-]
Client and serverThis function creates a default marker at a given position and outputs its type.
function createMarkerAndOutputType ( x, y, z ) -- we create the marker local theMarker = createMarker ( x, y, z ) -- if the marker was created, if ( theMarker ) then -- then get its type, local markerType = getMarkerType ( theMarker ) -- and output it. outputChatBox ( "It's a " .. markerType .. " marker!" ) end -- return the created marker element (or false) where this function was called return theMarker end