Add API to register custom "can fly checks"

This commit is contained in:
Niklp
2024-07-15 12:09:47 +02:00
parent 49a878aa03
commit 1c0270d7ec
2 changed files with 47 additions and 13 deletions

View File

@ -31,3 +31,17 @@ The hang glider will wear out every time you use it. The hang glider can be repa
If the `areas` mod is installed, airspace restrictions can be added to areas using the `/area_flak` command.
When using a hang glider in an area with flak enabled, you will get shot down a few seconds after entering the area, this reduces your HP to 1 and destroys your hang glider.
## API
#### Custom "can fly" checks
```lua
hangglider.add_fly_check(function(name, player)
-- `name` is the playername
-- `player` is the PlayerRef
-- Add your code here
-- Must return `true` (can fly) or `false` (can't fly)
return true
end)
```