[Release] [ESX] ESX_CommunityService

hey just wondering how i decrease the size of the txt that shows up in the chat window and second thing
when people get sentenced to community service when they leave the area they are teleported back but doesnt add any extra jobs to there sentence

RegisterServerEvent(‘esx_communityservice:extendService’)
AddEventHandler(‘esx_communityservice:extendService’, function()

local _source = source
local identifier = GetPlayerIdentifiers(_source)[1]

MySQL.Async.fetchAll('SELECT * FROM communityservice WHERE identifier = @identifier', {
	['@identifier'] = identifier
}, function(result)

	if result[1] then
		MySQL.Async.execute('UPDATE communityservice SET actions_remaining = actions_remaining + @extension_value WHERE identifier = @identifier', {
			['@identifier'] = identifier,
			['@extension_value'] = Config.ServiceExtensionOnEscape
		})
	else
		print ("ESX_CommunityService :: Problem matching player identifier in database to reduce actions.")
	end
end)

end)

First confirm the player’s ID has an entry in your database table “communityservice”, then replace that entire section with the following and test. If it works it should fulfill your needs, feel free to alter it.

RegisterServerEvent('esx_communityservice:extendService')
AddEventHandler('esx_communityservice:extendService', function()
    local xPlayer = ESX.GetPlayerFromId(source)
    local identifier = xPlayer.identifier

	MySQL.Async.execute('UPDATE communityservice SET actions_remaining = actions_remaining + @extension_value WHERE identifier = @identifier', {
		['@identifier'] = identifier,
		['@extension_value'] = Config.ServiceExtensionOnEscape
	})
end)

You basically have to replace the way that command is registed in server/main.lua

use ESX.RegisterCommand(‘comserv’, ‘admin’, function(xPlayer, args, showError)

(in both commands)

i have added the sql and ensured it per the instructions but /comserv does not work?
i am set as admin and still the same, also tried to set as pd job still says “invalid command”

how can i get this to work ??

Apostolos_Iatridis Για καποιο λογο οταν πληκτρολογο το command endcomserv λεει οτι δεν υπαρχει κατι τετοιο σε command αυτο το λεει και στο command comserv αλλα το comserv τουλαχιστον δουλευει στο staff menu ενω στο αλλο συνεχιζει να λεει οτι δεν υπαρχει τετοιο command (να σημειωθει οτι δεν εχω κανει καποια αλαγη στον κωδικα του script και το εχω κανει start απο το server.cfg)

Thank you sir working great !

legend, thanks for you help!

i keep getting invaild command /comserv can anybody help me out

Even if i put 1 or 100 or 1000 actions
when i finish 1 action i am free …
any ideas ?