GetObjectScale: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 16: Line 16:
==Example==
==Example==
<section name="Client" class="client" show="true">
<section name="Client" class="client" show="true">
This example adds a command ''get_scale'' which create object and prints out a scale object.
This example adds a command ''get_scale'' which create object and prints out a scale of the object.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
addCommandHandler( 'get_scale',
addCommandHandler( 'get_scale',
Line 29: Line 29:
==See Also==
==See Also==
{{Object_functions}}
{{Object_functions}}
[[Category:Needs_Example]]

Revision as of 22:48, 8 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

Click to collapse [-]
Client

This example adds a command get_scale which create object and prints out a scale of the object.

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

See Also