CreateDoor: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|Creates stateful doors which can be interacted with by players by pressing 'E'. Some of them are physics doors meaning they are..." |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Info|Function|Server|1.0}} | {{Info|Function|Server|1.0}} | ||
{{FuncDescription|Creates stateful doors which can be interacted with by players by pressing 'E'. Some of them are physics doors meaning they are pushed open by running against them.}} | {{FuncDescription|Creates stateful doors which can be interacted with by players by pressing 'E'. Some of them are physics doors meaning they are pushed open by running against them. | ||
See available doors here [[Doors]].}} | |||
{{FuncSyntax|CreateDoor(modelid, x, y, z, rotation [, bEnableInteract])}} | {{FuncSyntax|CreateDoor(modelid, x, y, z, rotation [, bEnableInteract])}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|modelid| | {{FuncParam|modelid|The door from this list: [[Doors]].}} | ||
{{FuncParam|x| | {{FuncParam|x|World X location.}} | ||
{{FuncParam|y| | {{FuncParam|y|World Y location.}} | ||
{{FuncParam|z| | {{FuncParam|z|World Z location.}} | ||
{{FuncParam|rotation| | {{FuncParam|rotation|Yaw rotation of the door.}} | ||
{{FuncParamOptional|bEnableInteract | | {{FuncParamOptional|bEnableInteract|'''true''' means it will send a request to the server when the player presses the 'E' key. '''false''' to disable that.}} | ||
{{FuncReturnValue| | {{FuncReturnValue|Returns the identifier to the door.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
function OnPackageStart() | |||
CreateDoor(40, -161386.000000, -39784.500000, 1085.000000, 0.0, true) | |||
end | |||
AddEvent('OnPackageStart', OnPackageStart) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{Template:DoorFunctions}} |
Latest revision as of 09:58, 12 December 2019
Description
Creates stateful doors which can be interacted with by players by pressing 'E'. Some of them are physics doors meaning they are pushed open by running against them.
See available doors here Doors.
Syntax
CreateDoor(modelid, x, y, z, rotation [, bEnableInteract])
Parameters
- modelid
The door from this list: Doors. - x
World X location. - y
World Y location. - z
World Z location. - rotation
Yaw rotation of the door. - bEnableInteract (optional)
true means it will send a request to the server when the player presses the 'E' key. false to disable that.
Return Value
- Returns the identifier to the door.
Example
function OnPackageStart()
CreateDoor(40, -161386.000000, -39784.500000, 1085.000000, 0.0, true)
end
AddEvent('OnPackageStart', OnPackageStart)