From c42193a9e20bb509c3e09858bfbb57eaf298444b Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 17 Sep 2022 13:38:21 +0200 Subject: [PATCH] update zones documentation --- docs/ox_lib/Zones/Client.md | 25 ++++++++++++++++++++++++- docs/ox_lib/index.md | 2 +- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/docs/ox_lib/Zones/Client.md b/docs/ox_lib/Zones/Client.md index 7da5b91f..81d8174a 100644 --- a/docs/ox_lib/Zones/Client.md +++ b/docs/ox_lib/Zones/Client.md @@ -1,4 +1,6 @@ -An alternative to PolyZone utilising [glm.polygon](https://github.com/gottfriedleibniz/lua/blob/luaglm/EXTENDED.md#polygon). +Faster alternative to PolyZone utilising [glm.polygon](https://github.com/gottfriedleibniz/lua/blob/luaglm/EXTENDED.md#polygon). + +## lib.zones.poly ```lua lib.zones.poly(data) @@ -8,8 +10,13 @@ lib.zones.poly(data) * All z values must match * thickness?: `number` * Default: `4` + * onEnter: `function`(self: `table`) + * onExit: `function`(self: `table`) + * inside: `function`(self: `table`) * debug?: `boolean` +## lib.zones.box + ```lua lib.zones.box(data) ``` @@ -19,8 +26,12 @@ lib.zones.box(data) * Default: `vec3(4, 4, 4)` * rotation?: `number` * Angle in degrees + * onEnter: `function`(self: `table`) + * onExit: `function`(self: `table`) + * inside: `function`(self: `table`) * debug?: `boolean` +## lib.zones.sphere ```lua lib.zones.sphere(data) @@ -29,8 +40,13 @@ lib.zones.sphere(data) * coords: `vector3` * radius?: `number` * Default: `2` + * onEnter: `function`(self: `table`) + * onExit: `function`(self: `table`) + * inside: `function`(self: `table`) * debug?: `boolean` +## Usage Examples + ```lua function onEnter(self) print('entered zone', self.id) @@ -92,3 +108,10 @@ poly:remove() sphere:remove() box:remove() ``` + +## Zone creation script +Similarly to PolyZone, there is a zone creation script included. + +To use it use the `/zone` with `poly`, `box` or `sphere` as args. + +Available controls will be displayed on the right side. diff --git a/docs/ox_lib/index.md b/docs/ox_lib/index.md index 4fd2f509..7cbed947 100644 --- a/docs/ox_lib/index.md +++ b/docs/ox_lib/index.md @@ -44,7 +44,7 @@ You can either import the whole library object which contains all the functions you can deconstruct it and import the functions you find needed at the time. ```ts -import lib from '@overextended/ox_lib/client' +import lib from '@overextended/ox_lib/server' ``` ```ts