[QBCore] Community Service

COMMUNITY SERVICE FOR QBCORE

I’ve just done an ESX to QBCore conversion of a free resource that I haven’t seen available for QB so far. It is my first transformation and contribution to cfx. I hope you find it useful, I will be attentive to your comments!

(original text)

An alternative form of punishment and social correction to jail. With this script, you can now send criminals in the central square, to provide community service by cleaning and gardening. Some say it’s more harsh than jail since citizens get to mock you while you are trying to do your time.
Try to escape it and you will get your service extended!

Features:

  • Admin commands
  • You can’t evade service with disconnects.
  • Trying to escape service will result in service extension.

REQUIREMENTS

  • QBCore (Only tested in latest version)
  • Oxmysql (Only tested in latest version)

Download: Github

(ESX) Original post and idea: [Release] [ESX] ESX_CommunityService

My intention will never be to steal an idea or credits, I just want to contribute to the cfx community since I have not seen this script for qb. If something is wrong delete the post, no problem. I have used google translate, sorry for the bad english

Changelog v1.1:

  • /pcomserv Added for cops. This command is for players with the police job to send to community service.
  • Updated the way oxmysql is used.
  • Updated fxmanifest

Changelog v1.2:

  • Fixed Server crash.
  • Now correctly checks if the character is sentenced when it spawns
  • Fixed Infinity Community Service when relogging the character
10 Likes

You may need to add permissions for police use only ? or is it me using it wrong

2 Likes

Hmmm, whoever will use this, don’t be surprised if all the players are put to work :smiley:

1 Like

If I’m not mistaken (first time using qbcore) the /comserv and /endcomserv commands are configured so that they can only be executed from the “admin” range

1 Like

The original (ESX) script integrates it into the police job using esx_menu_default, esx_menu_dialog and running a TriggerServerEvent on the police menu (You can see how it works in the original ESX post). Now if the public asks for it, I can create an exclusive command for police officers to send them to community service with the player’s ID. I accept any modification in order to improve the qb version, feel free to make a PR on github!

1 Like

If a cfx.re user knows how to improve the script and integrate it into qb-radialmenu I would appreciate it! <3

it does say admins and ive tried to change it to no avail

2 Likes

i prefer to stay in jail the punishment is the punishment :smiley:

1 Like

What’s your problem? Attach a photo or copy and paste the text of the error, maybe I can help you!

1 Like

NO problem buddy thanks for your work i have no errors at all just mentioning the police part thats all thanks again
:slight_smile:

1 Like

Of course, each server will use it if it sees fit, I use it on my server to sanction citizens who commit small illegal acts and also as an administrative sanction to avoid 1-day bans and cause people not to return for the ban

1 Like

Awesome work! :slight_smile:

1 Like

Thanks!

Hi. If you leave the server and then rejoin, then you are no more in Community Service. I see in the script is a check function for that, but it doesn’t working for me.

1 Like

Changelog v1.1:

  • /pcomserv Added for cops. This command is for players with the police job to send to community service.
  • Updated the way oxmysql is used.
  • Updated fxmanifest

Download: v1.1 Update qb-communityservice

1 Like

I keep getting this error

Thanks!

Anyone able to fix this?

At the moment I don’t have access to my pc or to a qb server to test, I’ll try to solve it as soon as I can. Whoever fixes it is free to make a PR!

works but gives errors