Files
overextended.github.io/docs/ox_lib/AddCommand/Server.md
T
2022-12-11 15:00:43 +11:00

19 lines
545 B
Markdown

```lua
lib.addCommand(principal, command, callback, parameters, help)
```
* principal: `string` or `string[]` or `false`
* command: `string`
* callback: `function`
* parameters?: `table` (`array`)
* help?: `string`
```lua
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)
end
end, {'target:number', 'item:string', 'count:number', 'metatype:?string'})
```