OnGateChange
A gate’s cycle changed - it started moving, or came to rest.
cycle is "opening" or "closing" when a cycle starts (from SetGateState, ToggleGate or an admin’s /gate) and
"open" or "closed" when the motion ran its length. pid is the admin whose /gate started it, -1 for the mode or
the server (a settle is always -1). A gate of the kind "gate" has no motion: it fires once, "open" or
"closed", with the pid of whoever switched it.
Syntax
Section titled “Syntax”function OnGateChange(key, cycle, pid) -- ...end| Parameter | Type | |
|---|---|---|
key |
string | the gate’s level name |
cycle |
string | "opening", "closing", "open" or "closed" |
pid |
number | the admin whose /gate did it, -1 for the mode or the server |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”function OnGateChange(key, cycle, pid) if cycle == "closed" then SendClientMessageToAll(COLOR_YELLOW, "The gate is shut. Nobody gets in or out.") endendSee also
Section titled “See also”SetGateState · ToggleGate · GetGateInfo · the Gates group of the index
