qbcore-framework / qb-core

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

[BUG] uppercase in jobname in AddJob() #1027

Closed iMex6K closed 10 months ago

iMex6K commented 1 year ago

Summary

If uppercase letters are used in the name when adding a job with AddJob() export, the job is added correctly but cannot be set with /setjob because the command forces lowercase letters.

Reproduction

  1. Add a new job in a resource with for example 'QBCore.Functions.AddJob("JobName", job)'.
  2. The new job will be added correctly to Shared.Jobs with the name "JobName" ( Debugged with print Shared.Jobs )
  3. If you now try to set the job for a user ingame with /setjob the command will be executed without any errors.
  4. Now check the job of the user or of yourself you will see that nothing has changed.
  5. The command /setjob forces the input to lowercase but "AddJob" does allow uppercase names.

https://github.com/qbcore-framework/qb-core/blob/4e184ba1c8a72cd5c0f08136c4578302dfbb2cd9/server/player.lua#L214

Expected behavior

There could be any error message. Either when you try to set the job with /setjob or better directly when you try to add the job with AddJob() and use uppercase in the name.

Or

Allow the use of uppercase in the name if it doesnt produce any errors in other scripts. ( I dont know why /setjob forced lowercase, maybe there is a reason for this )

Actual behavior

When try to set a job with uppercase in the name with /setjob nothin happens.

Additional context

No response

Last Updated

today

Custom Resources

-

Resource Rename

no

github-actions[bot] commented 10 months ago

This issue has had 60 days of inactivity & will close within 7 days