GetDoorLocation: Difference between revisions

From Onset Developer Wiki
No edit summary
No edit summary
 
Line 1: Line 1:
{{Info|Function|Server & Client|1.0}}
{{Info|Function|Server & Client|1.0}}


{{FuncDescription|Gets the XYZ vector of the specified door created earlier with [[CreateDoor]].}}
{{FuncDescription|Gets the XYZA vector of the specified door created earlier with [[CreateDoor]].}}


{{FuncSyntax|GetDoorLocation(door)}}
{{FuncSyntax|GetDoorLocation(door)}}
Line 8: Line 8:
{{FuncParam|door|The door specifier}}
{{FuncParam|door|The door specifier}}


{{FuncReturnValue|the x, y, z vectors of the door location.}}
{{FuncReturnValue|the x, y, z and yaw vectors of the door location.}}


== Example ==
== Example ==
<syntaxhighlight lang="Lua">
<syntaxhighlight lang="Lua">
AddCommand("doorlocation", function(playerid)
AddCommand("doorlocation", function(playerid)
local X, Y, Z = GetDoorLocation(doorid)
local X, Y, Z, A = GetDoorLocation(doorid)
AddPlayerChat(player, "Door location: "..X..", "..Y..", "..Z)
AddPlayerChat(player, "Door location: "..X..", "..Y..", "..Z..", "..A)
end)
end)
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 20:45, 7 March 2020

GetDoorLocation

Type: Function
Context: Server & Client
Introduced: v1.0

Description

Gets the XYZA vector of the specified door created earlier with CreateDoor.

Syntax

GetDoorLocation(door)

Parameters

  • door
    The door specifier

Return Value

  • the x, y, z and yaw vectors of the door location.

Example

AddCommand("doorlocation", function(playerid)
	local X, Y, Z, A = GetDoorLocation(doorid)
	AddPlayerChat(player, "Door location: "..X..", "..Y..", "..Z..", "..A)
end)

See also