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