Scripting/Server/Functions/GetDistance2D

Distance ignoring height.

Syntax

GetDistance2D(a, b)
GetDistance2D(x1, y1, x2, y2)

Arguments

Returns

float

Example

function onPlayerCommand( player, cmd, params )
{
	if ( cmd == "getdistance2d" )
	{
		local result = GetDistance2D( 0, 0 );
		MessagePlayer( "GetDistance2D returned: " + result, player );
	}
}

This sample was generated from the signature – adapt the values to your gamemode.

Section: Maths and strings

Categories: Server functions | Maths and strings