Thadah / helix-plugins

Helix plugins
GNU General Public License v3.0
2 stars 0 forks source link

MySQL Query Error! #3

Open CMAULTOP opened 1 month ago

CMAULTOP commented 1 month ago

[mysql] MySQL Query Error! Query: INSERT INTO ix_items (inventory_id, unique_id, data, x, y) VALUES ('0', 'intel', '[]', 'nil', 'nil') Incorrect integer value: 'nil' for column 'x' at row 1

CMAULTOP commented 1 month ago

https://github.com/Thadah/helix-plugins/blob/master/lootcontainers/sv_containers.lua#L128

Thadah commented 1 month ago

Does the inventory item you use have the correct values in sh_models.lua?

E.g

PLUGIN.containerModel["models/props_junk/garbage_bag001a.mdl"] = {
    name = "Garbage bag",
    desc = "A dusty bag.",
    invType = INV_TYPE_ID,
    openSound = "items/ammocrate_open.wav",
    invData = {
        w = 3,
        h = 2
    }
}

Since inv.Add(item) doesn't define x or y I think the problem might be coming from the inventory used for the container or the item that is being used to store. Does the item with the intel uniqueID have ITEM.width and ITEM.height correctly defined?

CMAULTOP commented 1 month ago

I do not know exactly what the error is. The bottom line is that I haven't changed anything in the plugin

Thadah commented 1 month ago

Ah, then that might be the issue. You see, the sh_categoriesrarities.lua and sh_models.lua are files that need to be modified to suit your needs and set the items you want inside the containers. The ones that are set right now are examples and you probably don't have them in your schema.

Since an item that the category has might not exist, it could be trying to insert something that doesn't exist, causing the nil when it's trying to be added to the database.

I'll look at the code to see if the existence of the uniqueID of the item is being checked. It's been a while since I developed it, so the check might not be implemented.

Try to set known items in sh_categoriesrarities.lua, see if it fixes the problem.

Thadah commented 1 month ago

I've added commit 8c9e14f to see if it fixes the issue. If what I think is right, a message in the console that says "Warning: Item does not exist in ix.item.list" should appear.

CMAULTOP commented 1 month ago

Nothing has changed. I specifically put 2 standard items in the config and still the same error(