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

feat: add function for billing per identifier instead of only source #19

Merged
merged 5 commits into from
Jun 20, 2024

Conversation

Z3rio
Copy link
Contributor

@Z3rio Z3rio commented Jun 19, 2024

This PR aims to primarily add a function to actually bill players based on their identifier, instead of only being able to bill by their source/player id.

Along making these changes, I also felt like incorporating server exports for this would be great, instead of juts having events that can only be triggered from the clientside. Hence the minor logic refactoring in the normal bill function.

Copy link
Contributor

@Gellipapa Gellipapa left a comment

Choose a reason for hiding this comment

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

Hi! Please do this little refactor but code cool thanks for improvment to esx_billing.

server/main.lua Outdated Show resolved Hide resolved
server/main.lua Outdated Show resolved Hide resolved
Copy link
Contributor

@Gellipapa Gellipapa left a comment

Choose a reason for hiding this comment

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

Hi! Thanks for fix, but please fix little problems.

server/main.lua Outdated Show resolved Hide resolved
server/main.lua Outdated Show resolved Hide resolved
server/main.lua Outdated Show resolved Hide resolved
server/main.lua Outdated Show resolved Hide resolved
@Z3rio
Copy link
Contributor Author

Z3rio commented Jun 20, 2024

@Gellipapa Why should if not xTarget then return end be preferred?
Just checking if xTarget isn't nil (aka the way its done right now) is a lot more logical, more readable, does the same thing, and takes less lines.

@Gellipapa
Copy link
Contributor

Gellipapa commented Jun 20, 2024

@Gellipapa Why should if not xTarget then return end be preferred? Just checking if xTarget isn't nil (aka the way its done right now) is a lot more logical, more readable, does the same thing, and takes less lines.

@Z3rio Hi! The basic logic is to deny because it will always be much more readable to get the actual result than to always write it in IF, look it up. In most cases it's most readable if you exclude everything line by line and at the end you only have the actual result before you always exit the code. This is a common and used method in software development.

https://dev.to/jpswade/return-early-12o5

Copy link
Contributor

@Gellipapa Gellipapa left a comment

Choose a reason for hiding this comment

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

Thanks for fixes i merged.

@Gellipapa Gellipapa merged commit 93ef807 into esx-framework:main Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants