Sleepless-Development / sleepless_inventory_addons

GNU General Public License v3.0
34 stars 17 forks source link

Weapons do not appear on the back. #11

Open lush0n3 opened 2 months ago

lush0n3 commented 2 months ago

Apparently with the latest version of ox_lib the models are not loaded, I don't have any type of error anywhere, just the obvious fact that the weapons do not appear.

ox_lib version '3.22.2'

This started happening when I updated the Ox libraries.

https://streamable.com/hq5dwq

Config.BackItems = {
    ['WEAPON_ASSAULTSMG'] = {
        prio = 3,
        group = 'back'
    },
    ['WEAPON_CARBINERIFLE'] = {
        prio = 3,
        group = 'back'
    },
    ['WEAPON_KATANA'] = {
        prio = 1,
        customPos = {
            overrideDefaultZ = true,
            pos = vec3(0.3, -0.14, 0.0),
            rot = vec3(0.0, 250.0, 0.0),
        }
    },
}
Demigod916 commented 2 months ago

ill check it out

Demigod916 commented 2 months ago

and this is the latest inventory addons?

Demigod916 commented 2 months ago

@lush0n3 image

i was still having the weapons on back with latest ox_lib. did you by chance upgrade your server artifacts as well? there were some things that broke with statebags on a recent artifact build

lush0n3 commented 2 months ago

That must be it, I'm using version 8509. What version do you use?

Demigod916 commented 2 months ago

i am on 7827 right now. you can try the latest one 8552 to see if its resolved

stone9k commented 2 months ago

We had to update to latest artifact, and enable Onesync Infinity in tx instead of in the server.cfg file. Then everything works fine.

stone9k commented 2 months ago

Did another test. 8509 = no waepon on back 8552 = weapon on back

lush0n3 commented 2 months ago

Thanks for your time!

lush0n3 commented 2 months ago

I have a new problem image

If I enter the server for the first time I get this error, if I then restart the resource it works, apparently it is a multicharacter esx problem.

After restarting the script image

SCRIPT ERROR: @sleepless_inventory_addons/backItems/client/main.lua:28: attempt to get length of a nil value (field '?')^7
createBackItemsForPlayer^7 (^5@sleepless_inventory_addons/backItems/client/main.lua^7:28)
ref^7 (^5@sleepless_inventory_addons/backItems/client/main.lua^7:97)
Gameadictive commented 2 months ago

sleepless_inventory_addons v2.2.4 ox_lib v3.22.2 server artifacts 8552 gamebuild 3095

Weapons on back not working

Error in client: 1

Start working after a ensure, what?

Demigod916 commented 2 months ago

Seems like same issue as the person above? Are you esx as well?

Gameadictive commented 2 months ago

Seems like same issue as the person above? Are you esx as well?

Yes, im using ESX and vms_multichars, vms_identity, vms_spawnselector and vms_charcreator. what about the guy up?

Demigod916 commented 2 months ago

I think i see the issue. Not directly related to esx, but i will get a fix out for it today or tomorrow

Gameadictive commented 2 months ago

I think i see the issue. Not directly related to esx, but i will get a fix out for it today or tomorrow

By they way i have a config custom for backItems that i would like people to collab. Where can i upload it?

Gameadictive commented 2 months ago

ADD: You can´t see others weapons on backs.

1

Demigod916 commented 2 months ago

definitely were able to before, maybe my latest update has a bug. chekcing this out now

Demigod916 commented 2 months ago

this should now be resolved in v2.2.5

Gameadictive commented 2 months ago

Still not seeing weapons on others.

Gameadictive commented 2 months ago

My bad? or

Demigod916 commented 2 months ago

My bad? or

Not entirely sure. I tested with 2 clients today and everything synced up perfectly. I know there are some recent issues with statebags on certain artifact versions. Not sure which versions, but maybe thats related.

edit: i tested with 2 clients on an ESX server

Gameadictive commented 2 months ago

I can´t test so much cause i dont have people to test it yesterday was lucky.

lush0n3 commented 2 months ago

After latest version '2.2.5', it works properly for me, I am using build 8552

I tested it on localhost and public server with more players.

Gameadictive commented 2 months ago

I will be testing it and telling u.

lush0n3 commented 2 months ago

New issue, some players are shown a weapon they do not have in their inventory

image image

Gameadictive commented 2 months ago

New issue, some players are shown a weapon they do not have in their inventory

image image

This is happening me using multichars with char1: char2: char3: if they join with char1 and change to char2 the weapons from char 1 are in the back.

Demigod916 commented 2 months ago

Ooooooh. So do you both have character swapping without relogging?

i swapped to storing the items using serverId vs using playerId so if they swap chars, it may be retaining data from the previous characters

Gameadictive commented 2 months ago

Ooooooh. So do you both have character swapping without relogging?

i swapped to storing the items using serverId vs using playerId so if they swap chars, it may be retaining data from the previous characters

F

lush0n3 commented 2 months ago

Ooooooh. So do you both have character swapping without relogging?

i swapped to storing the items using serverId vs using playerId so if they swap chars, it may be retaining data from the previous characters

I don't use that, what happens is that some players are shown a weapon they don't have in their inventory on their back.

Using multi-character Forcelog causes a lot of errors and I have it completely disabled on my server.

Demigod916 commented 2 months ago

Very interesting. Well i will add something for catching char swapping anyways. And i will also look for how it could possibly be assigning the wrong data to a player for weapons shown

my guess is that weapons from other players are getting attached to the player

Demigod916 commented 2 months ago

found the issue i think. here i thought serverids would be less of a headache than player ids

Demigod916 commented 2 months ago

OK. new version just pushed. should be fixed. let me know

lush0n3 commented 2 months ago

esx_multicharacter use esx:playerLoaded and esx:onPlayerLogout with which you can observe when a player uses forcelog or relog

https://github.com/esx-framework/esx_core/blob/0bc232185aa05462d161638551f6bc7dbb7d7894/%5Bcore%5D/esx_multicharacter/client/main.lua#L286

I'm going to update the repository and in an hour I'm going to restart the server, I'll tell you if the solution worked.

Gameadictive commented 2 months ago

For me now is working.

Demigod916 commented 2 months ago

i tested it in my esx server using /forcelog and it seemed to work fine. no items on the new character

Demigod916 commented 2 months ago

Ooooooh. So do you both have character swapping without relogging? i swapped to storing the items using serverId vs using playerId so if they swap chars, it may be retaining data from the previous characters

I don't use that, what happens is that some players are shown a weapon they don't have in their inventory on their back.

Using multi-character Forcelog causes a lot of errors and I have it completely disabled on my server.

i also fixed an issue that would cause items to be attached to you from other players, which i think is the issue you are experiencing

lush0n3 commented 2 months ago

It works correctly so far, I will let you know if there is anything.