Skip to content

Make sure license and check player bucket#676

Open
nurrifqialhusaini wants to merge 8 commits intoQbox-project:mainfrom
nurrifqialhusaini:main
Open

Make sure license and check player bucket#676
nurrifqialhusaini wants to merge 8 commits intoQbox-project:mainfrom
nurrifqialhusaini:main

Conversation

@nurrifqialhusaini
Copy link
Copy Markdown

@nurrifqialhusaini nurrifqialhusaini commented Feb 25, 2025

Description

server/events.lua just make sure the license its not nil (just make sure)
server/functions.lua check if bucket is 0 and using ternary operator

Checklist

  • I have personally loaded this code into an updated Qbox project and checked all of its functionality.
  • My pull request fits the contribution guidelines & code conventions.

@Frowmza
Copy link
Copy Markdown
Contributor

Frowmza commented Mar 4, 2025

I see this both useless

  • Any case will identifier will be nil?, also why you checking the license and not identifier
  • The bucket should never be nil. If someone wants to reset a player's bucket, they should pass 0. Even if we were to accept this, it would not match the function name SetPlayerBucket, and we would then be passing a nil bucket.

@nurrifqialhusaini
Copy link
Copy Markdown
Author

nurrifqialhusaini commented Mar 4, 2025

@Frowmza maybe someone wanna go back to bucket 0 and just destroy source from QBX.Player_Buckets ...
Like maybe make elevator script with bucket system and go back to bucket 0.. but if we SetPlayerBucket(source, 0) the QBX.Player_Buckets still saving our data like cached but the value is 0

@nurrifqialhusaini
Copy link
Copy Markdown
Author

New Project
Why not destroy when bring back to bucket 0 and just use 1 func not make other func

@Frowmza
Copy link
Copy Markdown
Contributor

Frowmza commented Mar 7, 2025

Then just check if bucket is 0 then destroy the data, i don't see why we need to allow bucket to be nil. Also, as i said we don't need that identifiers check, it will be never be nil.

@nurrifqialhusaini
Copy link
Copy Markdown
Author

nurrifqialhusaini commented Mar 7, 2025

thats why im using ternary operator for checking bucket 0

@Frowmza
Copy link
Copy Markdown
Contributor

Frowmza commented Mar 8, 2025

you're not listening, what I'm trying to clarify, that bucket shouldn't be nil, so if it nil we simply would return. If it passed as 0 then we reset and destroy

@nurrifqialhusaini
Copy link
Copy Markdown
Author

@Frowmza So you mean there should be a check to ensure bucket is not nil?

@Frowmza
Copy link
Copy Markdown
Contributor

Frowmza commented Mar 8, 2025

This will also be a breaking change. However, if QBX.Player_Buckets values is expected to never be nil, implementing it this way would result in the value being nil. And then break the code of who ever using it. Will hold this until we discuss it with team

@nurrifqialhusaini
Copy link
Copy Markdown
Author

@Frowmza Ahhh, I see, the data. Okay, I'll wait for the team's response.. 👍

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.

2 participants