OnPlayerInteractDoor: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Event|Server|1.0}} {{FuncDescription|Called when a player interacts with a door through pressing 'E'.}} {{FuncSyntax|OnPlayerInteractDoor(player, door, bWantsOpen)}}..." |
No edit summary |
||
Line 25: | Line 25: | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
[[Template:ServerEvents|Server Events]] |
Revision as of 09:49, 5 January 2020
Description
Called when a player interacts with a door through pressing 'E'.
Syntax
OnPlayerInteractDoor(player, door, bWantsOpen)
Parameters
- player
The player identifier. - door
The door identifier. - bWantsOpen
true if the door is currently closed on the client and therefore wants it open and vice versa.
Example
AddEvent("OnPlayerInteractDoor", function(player, door, bWantsOpen)
--AddPlayerChat(player, "Door: "..door..", "..tostring(bWantsOpen))
-- Let the players open/close the door by default.
if IsDoorOpen(door) then
SetDoorOpen(door, false)
else
SetDoorOpen(door, true)
end
end)