can someone help me figure out mysql?
i have read that and understand most of it, but i am new to this and kinda dumb about it lol. i’ve got a database up and have schemas and tables but for example im trying to add esx_addoninventory but keep getting an error on launch of server
Okay. To clarify a little. We mostly are having issues with figuring out how esx_addon inventory and food stores work together. We keep getting error codes. We have created the table for most of it. IE: Error code 107 also from the command prompt: Error running system, event handling function for resource esx_adddoninventory:citizen:scripting/lua/schedular.lua:41: failed to execute thres: server/main.lua:15:table index is nil
Inside of essentialmode\server\classes\player.lua there should be a line near the top that says
ExecuteCommand('add_principal identifier.' .. self.license .. " group." .. self.group)
Mine was on line 23
I commented this out to remove this error
what does this mean?
Also any advice on SQL? It is a bitch and a half. Also any idea where to get a up to date version of es_freemode. Having issues with es_extended
add --
in front of it.
What problems are you having with SQL? I run es_extended no problem. Haven’t used es_freemode.
Based on your error from before
local items = MySQL.Sync.fetchAll('SELECT * FROM items')
for i=1, #items, 1 do
Items[items[i].name] = items[i].label
end
Is that the line you are erroring on? I’d assume if there is no items
database table, that would be why the error happens… Do you have that table with items inside of it?
No. We have the table for items. it is just blank.Can you show me a format for adding items? We also are having issues trying to get the addon inventory to work. First time ever using MySql and Couchdb. For es_extended it kept coming up could not load resource when trying to connect.
INSERT INTO `essentialmode`.`items`
(`name`,`label`,`limit`,`rare`,`can_remove`)
VALUES
('pizza', 'Pizza', -1, 0, 1)
This would add an item for pizza. -1 means unlimited, rare is up to you and can_remove is self explanatory.
INSERT INTO `essentialmode`.`items`
(`name`,`label`,`limit`,`rare`,`can_remove`)
VALUES
('weedBag', 'Bag of Weed', 30, 0, 1)
This would let you have up to 30 bags of weed.
Not sure for addon_inventory. I haven’t used it, but should be the same. Make sure you run the .sql file.
Also make sure you run
start esx_addoninventory
after es_extended and mysql_async libraries. One thing with mysql-async it has to be in the main resources folder as well. /resources/msql-async
Most scripts will look for it here in their resources. Can you show me the error you’re having?
Would rare deal with how hard it is to successfully obtain the item?
Yeah, it’s up to you. You can have that work based on the items you want in there. I haven’t used it yet, but you could definitely do some cool things with it if you wanted.
Yeah. id is auto increment, so you don’t need to add it. It’s how SQL makes it easy to find things in the database. So all you need to do is
INSERT INTO items (name,label,limit) VALUES ('name','label',-1)
Would you be interested in remote connection to our server computer where this is? We use teamViewer
Sure PM me your info
thank you again for you help