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
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)
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)
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”
Apostolos_Iatridis Για καποιο λογο οταν πληκτρολογο το command endcomserv λεει οτι δεν υπαρχει κατι τετοιο σε command αυτο το λεει και στο command comserv αλλα το comserv τουλαχιστον δουλευει στο staff menu ενω στο αλλο συνεχιζει να λεει οτι δεν υπαρχει τετοιο command (να σημειωθει οτι δεν εχω κανει καποια αλαγη στον κωδικα του script και το εχω κανει start απο το server.cfg)
For anyone who has problems with the Script. I edited it so police can use the Command and did some other changes. Have fun with the script. Works like a charm on Esx Legacy
excelent! working in legacy, with a little problem, because my database change the length of the varchar, its only 46, and has problem to keep the track for the remain actions, but, works, any ideas why my database take the varchar 100 for the identifier, and when Im in the game its only varchar 46?