Scripting/Server/Functions/GetDistance

Straight-line distance between two Vectors.

Syntax

GetDistance(a, b)

Arguments

Returns

float

Example

function onPlayerCommand( player, cmd, params )
{
	if ( cmd == "getdistance" )
	{
		local result = GetDistance( 0, 0 );
		MessagePlayer( "GetDistance 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