diff --git a/docs/ox_lib/Callbacks/Client/index.md b/docs/ox_lib/Client/index.md similarity index 100% rename from docs/ox_lib/Callbacks/Client/index.md rename to docs/ox_lib/Client/index.md diff --git a/docs/ox_lib/Imports/Client/disableControls.md b/docs/ox_lib/Imports/Client/disableControls.md new file mode 100644 index 00000000..1569e17b --- /dev/null +++ b/docs/ox_lib/Imports/Client/disableControls.md @@ -0,0 +1,21 @@ +--- +title: lib.disableControls +--- + +```lua +lib.disableControls:Add(...) +lib.disableControls:Remove(...) +lib.disableControls:Clear(...) +lib.disableControls() +``` + +```lua +lib.disableControls:Add(23, 25, 36, 263) + +CreateThread(function() + while true do + Wait(0) + lib.disableControls() + end +end) +``` diff --git a/docs/ox_lib/Imports/Client/lib.callback/await.md b/docs/ox_lib/Imports/Client/lib.callback/await.md new file mode 100644 index 00000000..49551c71 --- /dev/null +++ b/docs/ox_lib/Imports/Client/lib.callback/await.md @@ -0,0 +1,14 @@ +--- +title: lib.callback.await +--- + +```lua +-- name: string +-- delay: number or false +lib.callback.await(name, delay, ...) +``` + +```lua +local count = lib.callback('ox_inventory:getItemCount', false, 'water', {type = 'fresh'}) +print(count) +``` diff --git a/docs/ox_lib/Imports/Client/lib.callback/index.md b/docs/ox_lib/Imports/Client/lib.callback/index.md new file mode 100644 index 00000000..0e91d5e6 --- /dev/null +++ b/docs/ox_lib/Imports/Client/lib.callback/index.md @@ -0,0 +1,16 @@ +--- +title: lib.callback +--- + +```lua +-- name: string +-- delay: number or false +-- cb: function +lib.callback(name, delay, cb, ...) +``` + +```lua +lib.callback('ox_inventory:getItemCount', false, function(count) + print(count) +end, 'water', {type = 'fresh'}) +``` diff --git a/docs/ox_lib/Commands/Server/index.md b/docs/ox_lib/Imports/Server/lib.addCommand.md similarity index 72% rename from docs/ox_lib/Commands/Server/index.md rename to docs/ox_lib/Imports/Server/lib.addCommand.md index 3560fcbc..6e9bc6ba 100644 --- a/docs/ox_lib/Commands/Server/index.md +++ b/docs/ox_lib/Imports/Server/lib.addCommand.md @@ -4,11 +4,11 @@ -- callback: function -- parameters: table (optional) -- help: string (optional) -lib.commands(principal, command, callback, parameters, help) +lib.addCommand(principal, command, callback, parameters, help) ``` ```lua -lib.commands('group.admin', {'additem', 'giveitem'}, function(source, args) +lib.addCommand('group.admin', {'additem', 'giveitem'}, function(source, args) args.item = Items(args.item) if args.item and args.count > 0 then Inventory.AddItem(args.target, args.item.name, args.count, args.metatype) diff --git a/docs/ox_lib/Imports/Server/lib.callback/register.md b/docs/ox_lib/Imports/Server/lib.callback/register.md new file mode 100644 index 00000000..2ef2546f --- /dev/null +++ b/docs/ox_lib/Imports/Server/lib.callback/register.md @@ -0,0 +1,17 @@ +--- +id: register +title: lib.callback.register +--- + +```lua +-- name: string +-- cb: function +lib.callback.register(name, cb) +``` + +```lua +lib.callback.register('ox_inventory:getItemCount', function(source, item, metadata, target) + local inventory = target and Inventory(target) or Inventory(source) + return (inventory and Inventory.GetItem(inventory, item, metadata, true)) or 0 +end) +``` diff --git a/docs/ox_lib/Imports/index.md b/docs/ox_lib/Imports/index.md new file mode 100644 index 00000000..10d5be00 --- /dev/null +++ b/docs/ox_lib/Imports/index.md @@ -0,0 +1,5 @@ +--- +title: Imports +--- + +These functions are loaded into the environment for the invoking resource. \ No newline at end of file diff --git a/docs/ox_lib/Callbacks/Server/index.md b/docs/ox_lib/Server/index.md similarity index 100% rename from docs/ox_lib/Callbacks/Server/index.md rename to docs/ox_lib/Server/index.md