DestroyDoor: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Server|1.0}} {{FuncDescription|Destroys a door that was earlier created by CreateDoor.}} {{FuncSyntax|DestroyDoor(door)}} {{FuncParameters}} {{FuncParam..." |
m Simple destroydoor example |
||
Line 11: | Line 11: | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua"> | |||
function cmd_destroydoor(player, door) | |||
if (IsValidDoor(door)) then | |||
return DestroyDoor(door) | |||
end | |||
AddPlayerChat(player, "Invalid door") | |||
end | |||
AddCommand("destroydoor", cmd_destroydoor) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
* [[IsValidDoor]] | |||
* [[GetDoorCount]] | |||
* [[GetDoorLocation]] | |||
* [[GetStreamedDoors]] | |||
* [[GetSoundCount]] |
Latest revision as of 23:38, 19 December 2019
Description
Destroys a door that was earlier created by CreateDoor.
Syntax
DestroyDoor(door)
Parameters
- door
The door to destroy.
Return Value
- Returns true on success.
Example
function cmd_destroydoor(player, door)
if (IsValidDoor(door)) then
return DestroyDoor(door)
end
AddPlayerChat(player, "Invalid door")
end
AddCommand("destroydoor", cmd_destroydoor)