35 lines
703 B
Markdown
35 lines
703 B
Markdown
### Function: GetCanGate(Spawn)
|
|
|
|
**Description:**
|
|
Checks if the Spawn is allowed to use Gate spells in this zone or area.
|
|
|
|
**Parameters:**
|
|
- `Spawn`: Spawn - The spawn to check if Gate is allowed.
|
|
|
|
**Returns:** None.
|
|
|
|
**Example:**
|
|
|
|
```lua
|
|
-- Example usage Spells/Commoner/CalltoHome.lua (spell to send player to their Bind with Gate)
|
|
function precast(Caster, Target)
|
|
if GetBoundZoneID(Caster) == 0 then
|
|
return false
|
|
end
|
|
|
|
if(GetCanGate(Caster) == 1)
|
|
then
|
|
return true
|
|
else
|
|
SendMessage(Caster, "You cannot use Call to Home from this location.", "red")
|
|
return false
|
|
end
|
|
|
|
return true
|
|
end
|
|
|
|
function cast(Caster, Target)
|
|
Gate(Caster)
|
|
end
|
|
```
|