ESX_CommunityService
https://i.imgur.com/RvFntG9.jpg
PS: I’d be glad if a mod could push me to the releases section.
Special thanks to @juliiiocesar for adding objects to the animations!
INTRODUCTION
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
- ESX
- ESX skinchanger ( skinchanger )
Download & Installation
Using Git
- cd resources
- git clone GitHub - apoiat/ESX_CommunityService: Fivem [ESX] An alternative form of punishment and reformation for criminals. [esx]/esx_communityservice
Manually
- Download https://github.com/apoiat/esx_communityservice/archive/master.zip
- Put it in the
[esx]
directory
Installation
- Import
esx_communityservice.sql
in your database- Add this in your server.cfg :
start esx_communityservice
How to apply community service.
- Use the
esx_communityservice:sendToCommunityService(target, service_count)
server trigger.- Use the
/comserv player_id service_count
command (only admins).- Use the
/endcomserv player_id
to finish a player’s community service (only admins).
How to add to policejob menu.
Example in esx_policejob: client/main.lua
:
{label = _U('fine'), value = 'fine'},
--add code below (don't forget to add ',' before new row)
{label = "Community Service", value = 'communityservice'}
elseif action == 'unpaid_bills' then
OpenUnpaidBillsMenu(closestPlayer)
-- add code below
elseif action == 'communityservice' then
SendToCommunityService(GetPlayerServerId(closestPlayer))
end
--add this function
function SendToCommunityService(player)
ESX.UI.Menu.Open('dialog', GetCurrentResourceName(), 'Community Service Menu', {
title = "Community Service Menu",
}, function (data2, menu)
local community_services_count = tonumber(data2.value)
if community_services_count == nil then
ESX.ShowNotification('Invalid services count.')
else
TriggerServerEvent("esx_communityservice:sendToCommunityService", player, community_services_count)
menu.close()
end
end, function (data2, menu)
menu.close()
end)
end
Other scripts by me:
[Release] [ESX] ESX_Cargodelivery
[RELEASE] ESX Deliveries - #9 by NebelRebell