GetObjectScale: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Server client function}} This function returns the visible size of an object. ==Syntax== <syntaxhighlight lang="lua"> float getObjectScale ( object theObject ) </syntaxhighlight> ===Require...")
 
No edit summary
Line 15: Line 15:


==Example==
==Example==
<section name="Client" class="client" show="true">
This example creates an object and output in chat scale.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
-- TODO
addCommandHandler( 'get_scale',
function( )
local uObject = createObject( 1337, getElementPosition( localPlayer ) )
outputChatBox( string.format( 'Object scale is %s !', getObjectScale( uObject ) ) )
end
)
</syntaxhighlight>
</syntaxhighlight>



Revision as of 20:21, 7 March 2012

This function returns the visible size of an object.

Syntax

float getObjectScale ( object theObject )

Required Arguments

  • theObject: The object you wish to return the scale of.

Returns

Returns a float indicating the scale of the object, if successful. false otherwise.

Example

<section name="Client" class="client" show="true"> This example creates an object and output in chat scale.

addCommandHandler( 'get_scale',
	function( )
		local uObject = createObject( 1337, getElementPosition( localPlayer ) )
		outputChatBox( string.format( 'Object scale is %s !', getObjectScale( uObject ) ) )
	end
)

See Also