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

Add MP.Get #369

Merged
merged 2 commits into from
Sep 28, 2024
Merged

Add MP.Get #369

merged 2 commits into from
Sep 28, 2024

Conversation

WiserTixx
Copy link
Contributor

@WiserTixx WiserTixx commented Sep 21, 2024

Adds MP.Get(ConfigID) to the lua api to get the current server settings.

lua> print(MP.Get(MP.Settings.Name]))
[LUA] BeamMP Server
lua> MP.Set(MP.Settings.Name, 'Hello World')
[INFO] Set `Name` to Hello World
lua> print(MP.Get(MP.Settings.Name))
[LUA] Hello World

Closes #146

@lionkor
Copy link
Member

lionkor commented Sep 22, 2024

Nice, thank you. An overhaul is in order though, this entire interface of Set and Get is so godawful.

Also, instead of MP.Set(MP.Settings['Name'], 'Hello World'), prefer MP.Set(MP.Settings.Name, 'Hello World').

Copy link
Member

@lionkor lionkor left a comment

Choose a reason for hiding this comment

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

One style thing, otherwise looks good :) Thanks very much

src/LuaAPI.cpp Outdated Show resolved Hide resolved
@WiserTixx
Copy link
Contributor Author

The obsolete breaks have been removed

@lionkor lionkor merged commit 55f1a3c into BeamMP:minor Sep 28, 2024
9 checks passed
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.

[Feature Request] Lua: MP.Get function
2 participants