esx_core icon indicating copy to clipboard operation
esx_core copied to clipboard

[Feature Request] - ADD STATE BAG - isLoggedIn

Open Mesrine67 opened this issue 1 year ago • 4 comments

Add the isLoggedIn statebag for better management, especially for developers creating content compatible with multiple frameworks.

Mesrine67 avatar Apr 20 '24 01:04 Mesrine67

ESX.PlayerLoaded already exists

Thekuca avatar Apr 20 '24 13:04 Thekuca

yes but I ask for a statebag

Mesrine67 avatar Apr 21 '24 04:04 Mesrine67

yes but I ask for a statebag

Hi! It's a global client side variable, it works exactly like the statebag, you create a custom method to check the framework types and set the ESX.PlayerLoaded variable in your statebage in playerLoaded so you can use it for multiple frameworks.

I don't see the benefit of putting a global variable that is already client-side accessible in statebag.

Where are you stuck or why do you think a statebag is needed?

Gellipapa avatar Apr 21 '24 11:04 Gellipapa

these so as not to have to go through the ESX variable and go through the statebag

Mesrine67 avatar Apr 25 '24 07:04 Mesrine67

You can still set your own state via two event handlers, one is onPlayerLoaded and the other is the playerDropped. Literally no need to add a state next to a client side function, you can register a state yourself too.

FUst1ke avatar May 19 '24 18:05 FUst1ke

I really don't see any benefit of implementing this in esx legacy.

Arctos2win avatar May 19 '24 22:05 Arctos2win