[Release] Inventory System v2.1 (Personal Menu)

Better with

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)      
        if IsEntityDead(PlayerPedId()) then
            RegisterNetEvent("item:Reset")
            TriggerServerEvent("item:Reset")
        end
    end
end)

There is an extra “end” that serves no purpose

1 Like

Oops, i’ll fix it in my file, thx.

1 Like

Not work db mysql :

Erreur
Requête SQL :

CREATE TABLE `user_inventory` (
  `user_id` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
  `item_id` int(11) unsigned NOT NULL,
  `quantity` int(11) DEFAULT NULL,
  PRIMARY KEY (`user_id`,`item_id`),
  KEY `item_id` (`item_id`),
  CONSTRAINT `user_inventory_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`identifier`),
  CONSTRAINT `user_inventory_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

#1071 - Specified key was too long; max key length is 767 bytes 

pliz fix it thx :slight_smile:

guys look the topic !!!

@Vodkhard fix it in the file or add it ont frist topic

Error Code: 1068. Multiple primary key defined ?

I fix this, if your user line is in Primary key, delete the primary key, and when you will execute this SQL file, it will be good.

@MO_SnipZo

1 Like

Screens ? It is possible ?

I have exactly the same error

You can delete this message :slight_smile:

thank :ok_hand:
fix Error Code: 1068. Multiple primary key defined

Thanks, the fix will be work @Tospik

Nobody know for me ?! http://prntscr.com/eyupz4

Yes i have a same error pls help

1 Like

Dude you d’ont know he do these http://prntscr.com/eyvcfm ?

Ok so i have fixed http://prntscr.com/eyvkev

so on users you have a identifier like: http://prntscr.com/eyvkwn
so you need to create a index like: http://prntscr.com/eyvl8e
and you need to down the 255 value on 70 like on my screen
so after do that go to user_inventory and do the same of me ^^ like:
http://prntscr.com/eyvlzz
http://prntscr.com/eyvm7l
and go test now in game.

Can you make an exemple for how to add a item please ? i mean the syntax :slight_smile:

Nervermind i found it… But how we can test the item ? have you a script for add item to the player ?

1 Like

I’m working on a script of recolting items but now you can’t really test it, that why

I wrote It’s a resource more for developers.

:wink:

3 Likes

It’s fast to create it ?

Ayone have good sql script for me please it’s not working with fix for me
Thanks