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(server): deprecate player functions #611

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

mafewtm
Copy link
Member

@mafewtm mafewtm commented Oct 26, 2024

Description

This PR deprecated all player.Functions... in favor of having some of them be exports. A list of their replacements are below:

Identifier is either source or citizenId as to handle both online and offline players.

Replacements:

player.Functions.SetJob(jobName, grade) → exports.qbx_core:SetJob(identifier, jobName, grade)
player.Functions.SetGang(gangName, grade) → exports.qbx_core:SetGang(identifier, gangName, grade)
player.Functions.SetJobDuty(onDuty) → exports.qbx_core:SetJobDuty(identifier, onDuty)
player.Functions.SetMetaData(meta, val) → exports.qbx_core:SetMetadata(identifier, metadata, value)
player.Functions.GetMetaData(meta) → exports.qbx_core:GetMetadata(identifier, metadata)
player.Functions.AddMoney(moneytype, amount, reason) → exports.qbx_core:AddMoney(identifier, moneyType, amount, reason)
player.Functions.RemoveMoney(moneytype, amount, reason) → exports.qbx_core:RemoveMoney(identifier, moneyType, amount, reason)
player.Functions.SetMoney(moneytype, amount, reason) → exports.qbx_core:SetMoney(identifier, moneyType, amount, reason)
player.Functions.GetMoney(moneytype) → exports.qbx_core:GetMoney(identifier, moneyType)

Removals:

player.Functions.SetCreditCard(cardNumber) -- use SetCharInfo instead
player.Functions.AddJobReputation(amount) -- use SetMetadata instead
player.Functions.Functions.Save() -- use Save or SaveOffline instead

Additions:

exports.qbx_core:SetCharInfo(identifier, charInfo, value)

I've tested most of these and haven't encountered any issues. Idk if any of this should be done different or if we want to add/remove anything else.

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.

@mafewtm mafewtm closed this Oct 27, 2024
@mafewtm mafewtm deleted the deprecate-player-functions branch October 27, 2024 22:30
@mafewtm mafewtm restored the deprecate-player-functions branch October 27, 2024 22:39
@mafewtm mafewtm reopened this Oct 27, 2024
server/commands.lua Outdated Show resolved Hide resolved
server/commands.lua Outdated Show resolved Hide resolved
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