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.
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
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
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!
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
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.