Skip to content

Conversation

@JericoFX
Copy link

Describe Pull request
This eliminate the for loop and add a check on server side to see if the player has the radio or not.

If your PR is to fix an issue mention that issue here

Questions (please complete the following information):

  • Yes
  • Yes
  • Yes

@JericoFX
Copy link
Author

this clean this error on start
image

@Cocodrulo
Copy link
Contributor

Cocodrulo commented Jan 12, 2025

There is a QBCore function QBCore.Functions.HasItem(itemname, quant) to handle this. This avoids the callback.


hasRadio = _hasRadio
local function DoRadioCheck()
QBCore.Functions.TriggerCallback("qb-radio::server::hasRadio", function(value)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the two double ::?

Copy link
Author

Choose a reason for hiding this comment

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

thats stick with me when i was programming in altv

Copy link
Contributor

@Cocodrulo Cocodrulo left a comment

Choose a reason for hiding this comment

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

Change all of this logic with QBCore.Functions.HasItem(name, quant)

@JericoFX JericoFX closed this Jan 15, 2025
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.

3 participants