esx-framework / esx_core

Official Repo For core resources for esx-legacy
https://documentation.esx-framework.org/
GNU General Public License v3.0
356 stars 737 forks source link

[Feature Request] - ADD STATE BAG - isLoggedIn #1348

Closed Mesrine67 closed 2 months ago

Mesrine67 commented 3 months ago

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

Thekuca commented 3 months ago

ESX.PlayerLoaded already exists

Mesrine67 commented 3 months ago

yes but I ask for a statebag

Gellipapa commented 3 months ago

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?

Mesrine67 commented 2 months ago

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

FUst1ke commented 2 months ago

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.

Arctos2win commented 2 months ago

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