[Release] [ESX] [Police Job]

How do I replace the en.lua with the fr.lua?

Got the same error [20]

For all ESX resources you should have a folder called “Locale”. That will indicate which languages the script is available in. “fr” = French.

So what you’ll want to do is open the “config.lua” and change the “Config.Locale” line to = ‘fr’ and save.

  • P

I figured it out but really appreciate your help. Thanks so much!

Found fix yet? [1 year later]

Error running call reference function for resource essentialmode: citizen:/scripting/lua/scheduler.lua:351: citizen:/scripting/lua/MessagePack.lua:830: missing bytes
stack traceback:
[C]: in function ‘error’
citizen:/scripting/lua/MessagePack.lua:830: in method ‘underflow’
citizen:/scripting/lua/MessagePack.lua:465: in field ‘any’
citizen:/scripting/lua/MessagePack.lua:860: in field ‘unpack’
citizen:/scripting/lua/scheduler.lua:563: in upvalue ‘callback’
server/main.lua:213: in upvalue ‘ref’
citizen:/scripting/lua/scheduler.lua:337: in function citizen:/scripting/lua/scheduler.lua:336
[C]: in function ‘xpcall’
citizen:/scripting/lua/scheduler.lua:336: in function citizen:/scripting/lua/scheduler.lua:335
stack traceback:
[C]: in function ‘error’
citizen:/scripting/lua/scheduler.lua:351: in function citizen:/scripting/lua/scheduler.lua:322
hitch warning: frame time of 172 milliseconds

Happens when Im trying to /setjob [ID] POLICE 1

Set job in your Database sql

You dont got ESX probably, you probably got the citmp version.

You look like a guy who’s nice enough to tell me :slight_smile:

So the question is: “How do I set job?”

/setjob 1 police 1

doesnt work. Am I suppoed to write the name of the rank or a number? Is the job called police? Or is it called like “Cop” or “policejob” “esxjob” etc? Hope you understand. Please write an example of how you write the “Setjob”

I use the database itself and go to users, then click the data tab. One of the fields says Job and you use “police”. Then you find the grade and use 0 or 1 or 2 or 3 etc. (There is a table labeled job_grade I believe that you can check to see positions and rank numbers). After you set those you can refresh SQL and it should save.

Also, make sure you set your group for your name only to “superuser” (or it may be superadmin).

To use text chat command in game I believe it’s:
setjob player-ID jobname jobgrade
setjob 20 police 0

-P

I have a few minutes on my lunch break so I hopped in the server to take a few screen shots as a visual aid for the previous post.

Here is where you can check the Job Grade Number and the respective Position:

  1. Expand essentialmode Database and click on the job_grades table
  2. Click on the Data Tab

You can check the number to the position and you can also add or remove/edit Job Grades. I’ve actually modified the police_job resource and created 3 seperate departments with all the ranks for my Community.

NOTE Any job grade that has “boss” under the name column will have access to the Player Management feature when they enter a Law Enforcement Office in game. This allows you to Recruit (hire), promote/demote, and Fire players within that agency.

Using the table above, if you wanted to promote someone to Asst. Chief of the LSPD, you can just go down to the users table and edit it (player needs to have already connected to the server at least once).

NOTE Highlight essentialmode database and refresh prior to completing steps below.

  1. Expand essentialmode Database and click on the users table
  2. Click on the Data Tab
  3. Edit the job & job_grade fields for the desired user
  4. Refresh essentialmode again (as stated in Note above) and check to make sure the information saves. Sometimes I have to repeat the step once or twice. I’m not in game much and I have access to my DB from any computer through RDP so this makes it the best way to manage players in my situation.
    **If the player is logged in while you edit the DB, they will need to restart FiveM and rejoin server.

2 Likes

appreicate all your help really much!

Why so extremly nice?! Thanks!

How do I add another police as an LSPD - Officer?
Will my DB remain if I switch computer?

If you want to add ranks you just go to the job_ranks table and insert lines. You manually set the different columns to suit your needs. Use my screenshot as an example. Just remember to keep the rank “boss” for the top level position.

I only have experience with SQL and I leave it in the default location (same system I’m hosting my fivem server on) You can relocate or create a new database but you will need to edit multiple resources in your esx files to point to the database.

Hopefully I answered the right question…

-P

2 Likes

Because I’ve been in the position you’re in. Needing help with a resource and not having much help in resolving. So I know where you’re coming from and if I can help people with issues, then I try. There are some very responsive members who do a great job with helping others, but it all depends on which post you’re in and who’s watching the comments.

-P

2 Likes

Just sayin, thanks! Learned so much of you. Will help others with what I can now even thoe Iam a beginner myself. Thanks!

No Problem and You’re welcome. We all started out knowing nothing

Do you maybe know why everything is like duplicated or tripiclated? Or is it? @RPPerry3

https://gyazo.com/a7f3b6f2d0c54c68c374097def4942e2
https://gyazo.com/10ad4eb5d9345d6873dca1c730ab2809

Looks like you ran the .sql for the jobs over and over. take a screen of your jobs table. Are jobs listed more than once?