GetMarkerSize: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(fixed example)
 
(4 intermediate revisions by 4 users not shown)
Line 4: Line 4:


==Syntax==
==Syntax==
<section name="Server" class="server">
<syntaxhighlight lang="lua">float getMarkerSize ( marker myMarker )</syntaxhighlight>
<syntaxhighlight lang="lua">float getMarkerSize ( marker myMarker )</syntaxhighlight>
 
{{OOP||[[Marker]]:getSize|size|setMarkerSize}}
===Required Arguments===
*'''myMarker''': The [[marker]] that you wish to retrieve the size of.
 
===Returns===
Returns a [[float]] containing the size of the specified marker.
</section>
<section name="Client" class="client">
<syntaxhighlight lang="lua">float getMarkerSize ( marker myMarker )</syntaxhighlight>
 
===Required Arguments===
===Required Arguments===
*'''myMarker''': The [[marker]] that you wish to retrieve the size of.
*'''myMarker''': The [[marker]] that you wish to retrieve the size of.
Line 21: Line 11:
===Returns===
===Returns===
Returns a [[float]] containing the size of the specified marker.
Returns a [[float]] containing the size of the specified marker.
</section>


==Example==
==Example==
This example creates a marker and outputs the size to everyone. (server/client)
This example creates a marker and outputs the size to everyone.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
-- Create a maker
-- Create a maker
newMarker = createMarker ( 1, 1000, 1000, 1000, 1,0,0 )
local newMarker = createMarker ( 0, 0, 2, "cylinder", 2, 255, 0, 0, 255 )
-- If the marker was created successfully then...
-- If the marker was created successfully then...
if ( newMarker ~= false ) then
if isElement ( newMarker ) then
-- Tell everyone about it
    -- Tell everyone about it
outputChatBox ( "Current marker size: " .. getMarkerSize ( newMarker ) )
    outputChatBox ( "Current marker size: " .. getMarkerSize ( newMarker ) )
end
end
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 12:53, 10 October 2023

This function returns a float containing the size of the specified marker.

Syntax

float getMarkerSize ( marker myMarker )

OOP Syntax Help! I don't understand this!

Method: Marker:getSize(...)
Variable: .size
Counterpart: setMarkerSize


Required Arguments

  • myMarker: The marker that you wish to retrieve the size of.

Returns

Returns a float containing the size of the specified marker.

Example

This example creates a marker and outputs the size to everyone.

-- Create a maker
local newMarker = createMarker ( 0, 0, 2, "cylinder", 2, 255, 0, 0, 255 )
-- If the marker was created successfully then...
if isElement ( newMarker ) then
    -- Tell everyone about it
    outputChatBox ( "Current marker size: " .. getMarkerSize ( newMarker ) )
end

See Also