qbcore-framework / qb-core

FiveM RP Framework Core :muscle:
GNU General Public License v3.0
590 stars 960 forks source link

Add GetPlayerByLicense function #982

Closed DaniGP17 closed 1 year ago

DaniGP17 commented 1 year ago

Description

This pull request introduces a new function called GetPlayerByLicense. The purpose of this function is to retrieve player data based on their license.

Change Summary: The addition of the GetPlayerByLicense function enhances the functionality of qb-core by allowing developers to easily access player data using their license as a parameter. This feature provides a streamlined method for retrieving specific player information, contributing to the overall efficiency and convenience of the qb-core framework.

Code Example

local Player = QBCore.Functions.GetPlayerByLicense('license:xxxxxxxxxxxxxxxxxxxx')

Checklist

GhzGarage commented 1 year ago

Might wanna double check your query via the docs https://overextended.github.io/docs/oxmysql/Usage/prepare

DaniGP17 commented 1 year ago

Ready I've used MySQL.Sync.prepare function because here that was used to select a player by the citizenid. https://github.com/qbcore-framework/qb-core/blob/main/server/player.lua#L41

GhzGarage commented 1 year ago

That brings up a good point, could you update that in your PR to change the other as well. Thank you!

DaniGP17 commented 1 year ago

That brings up a good point, could you update that in your PR to change the other as well. Thank you!

Done, sorry for being late

DaniGP17 commented 1 year ago

Any update with this?