Minor changes

This commit is contained in:
ElPumpo
2018-07-03 11:44:20 +02:00
parent b39f5563c8
commit bc648c6727
3 changed files with 53 additions and 28 deletions
+36 -15
View File
@@ -1,37 +1,58 @@
# fxserver-esx_addoninventory
ESX AddonInventory
# esx_addoninventory
[INSTALLATION]
## Download & Installation
1) CD in your resources/[esx] folder
2) Clone the repository
### Using [fvm](https://github.com/qlaffont/fvm-installer)
```
git clone https://github.com/FXServer-ESX/fxserver-esx_addoninventory esx_addoninventory
fvm install --save --folder=esx esx-org/esx_addoninventory
```
3) Import esx_addoninventory.sql in your database
1) Add this in your server.cfg :
### Using Git
```
cd resources
git clone https://github.com/ESX-Org/esx_addoninventory [esx]/esx_addoninventory
```
### Manually
- Download https://github.com/ESX-Org/esx_addoninventory/archive/master.zip
- Put it in the `[esx]` directory
## Installation
- Import `esx_addoninventory.sql` in your database
- Add this in your `server.cfg`:
```
start esx_addoninventory
```
[USAGE]
## Usage
There is two types of inventories : shared and not shared.
- Shared inventories dont belong to a specific user. Example : foodstore items.
- Not shared inventories are created for every user in the server. They are created in db when player is loaded, Example : property items
- Shared inventories dont belong to a specific user. Example: foodstore items.
- Not shared inventories are created for every user in the server. They are created in db when player is loaded, Example: property items
You must create the inventory in the database (addon_inventory) before using it :
name = name of the inventory, label = label of the inventory, shared (0 or 1) = Is inventory shared
```
```lua
TriggerEvent('esx_addoninventory:getSharedInventory', 'main_grocery', function(inventory)
inventory.addItem('bread', 1)
inventory.addItem('bread', 1)
end)
TriggerEvent('esx_addoninventory:getInventory', 'property', 'steam:0123456789', function(inventory)
inventory.removeItem('water', 1)
inventory.removeItem('water', 1)
end)
```
# Legal
### License
esx_addoninventory - inventories!
Copyright (C) 2015-2018 Jérémie N'gadi
This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version.
This program Is distributed In the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty Of MERCHANTABILITY Or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License For more details.
You should have received a copy Of the GNU General Public License along with this program. If Not, see http://www.gnu.org/licenses/.
+3 -1
View File
@@ -8,4 +8,6 @@ server_scripts {
'@mysql-async/lib/MySQL.lua',
'server/classes/addoninventory.lua',
'server/main.lua'
}
}
dependency 'es_extended'
+14 -12
View File
@@ -1,18 +1,20 @@
USE `essentialmode`;
CREATE TABLE `addon_inventory` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`label` varchar(255) NOT NULL,
`shared` int(11) NOT NULL,
PRIMARY KEY (`id`)
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`label` varchar(255) NOT NULL,
`shared` int(11) NOT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE `addon_inventory_items` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`inventory_name` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`count` int(11) NOT NULL,
`owner` varchar(60) DEFAULT NULL,
PRIMARY KEY (`id`)
);
`id` int(11) NOT NULL AUTO_INCREMENT,
`inventory_name` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`count` int(11) NOT NULL,
`owner` varchar(60) DEFAULT NULL,
PRIMARY KEY (`id`)
);