GetDistanceBetweenElements

From Multi Theft Auto: Wiki
Revision as of 08:28, 18 June 2018 by Kevinnl03 (talk | contribs) (Created page with "==Syntax== <syntaxhighlight lang="lua">int getDistanceBetweenElements(arg1, arg2)</syntaxhighlight> ===Required Arguments=== * '''arg1''': Requiere un Object/Vehicle/Ped/Play...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Syntax

int getDistanceBetweenElements(arg1, arg2)

Required Arguments

  • arg1: Requiere un Object/Vehicle/Ped/Player.
  • arg2: Requiere un Object/Vehicle/Ped/Player.

Returns

Retorna la distancia entre los dos puntos.

Code

Click to collapse [-]
Uso en Client/Server - Side
function getDistanceBetweenElements(arg1, arg2)
	local element1 = Vector3(getElementPosition( arg1 ))
	local element2 = Vector3(getElementPosition( arg2 ))
	local distance = getDistanceBetweenPoints3D( element1,element2 )
	return distance
end

Author: Clark_Devlin