Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/feat(es_extended): Basic Statebags + Correct vehicle spawning #696

Merged
merged 5 commits into from
Nov 26, 2022

Conversation

Mycroft-Studios
Copy link
Contributor

No description provided.

@Mycroft-Studios Mycroft-Studios changed the title fix/feat(es_extended): Basic Statebags + Correct vehicle spawing fix/feat(es_extended): Basic Statebags + Correct vehicle spawning Nov 24, 2022
Comment on lines +22 to +27

Player(self.source).state:set("identifier", self.identifier, true)
Player(self.source).state:set("license", self.license, true)
Player(self.source).state:set("job", self.job, true)
Player(self.source).state:set("group", self.group, true)
Player(self.source).state:set("name", self.name, true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you keep calling the Player() function?

Suggested change
Player(self.source).state:set("identifier", self.identifier, true)
Player(self.source).state:set("license", self.license, true)
Player(self.source).state:set("job", self.job, true)
Player(self.source).state:set("group", self.group, true)
Player(self.source).state:set("name", self.name, true)
local stateBag = Player(self.source).state
stateBag:set("identifier", self.identifier, true)
stateBag:set("license", self.license, true)
stateBag:set("job", self.job, true)
stateBag:set("group", self.group, true)
stateBag:set("name", self.name, true)

Maybe we can make it so that xPlayer.set is rewritten and uses statebag

Or new function xPlayer.setStatebag/xPlayer.setState

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could add more states like "handcuffed", "dragged", "onduty" and more

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could add more states like "handcuffed", "dragged", "onduty" and more

🫣

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or new function xPlayer.setStatebag/xPlayer.setState

then there would be no point in statebags

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would also be a statebag, only simpler. And it would be available from xPlayer

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it's just an idea.

fixes 'id' issue, also fixes the "TextUI Is not displaying!" issues :)
This should in theory, stop the event from being abused, since mod menus were previously able to Trigger This event to set the user to a whitelisted job, assuming the user was near the job centre, so this now checks to make sure that the job is a non-whitelisted job, and warns when abused
SendNUIMessage({
action = 'show',
message = message and message or 'ESX-TextUI',
type = type(typ) == "string" and typ or 'info'
type = type == 0 and "info" or type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An earlier error was the type number, which can only be a string. I think it should be the original.
Or put it in so that it can only be a string type.

@Benzo00 Benzo00 merged commit 4f7c6c3 into esx-framework:main Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants