Hi, in this case i want put the Character Name in place of Steam Name. but i when copy the function from “esx_rpchat” the script doesn´t work. anyone can help me? thank you and sorry for my bad english
config.lua
Config = {}
-- # Locale to be used. You can create your own by simple copying the 'en' and translating the values.
Config.Locale = 'en'
-- Enable this to use Esx Identity
Config.EnableESXIdentity = true
-- # By how many services a player's community service gets extended if he tries to escape
Config.ServiceExtensionOnEscape = 8
-- # Don't change this unless you know what you are doing.
Config.ServiceLocation = {x = 189.41, y = -855.36, z = 31.37}
-- # Don't change this unless you know what you are doing.
Config.ReleaseLocation = {x = 427.33, y = -979.51, z = 30.2}
-- # Don't change this unless you know what you are doing.
Config.ServiceLocations = {
{ type = "cleaning", coords = vector3(199.04, -855.07, 30.89) },
{ type = "cleaning", coords = vector3(190.36, -851.04, 31.14) },
{ type = "cleaning", coords = vector3(193.61, -860.53, 31.37) },
{ type = "cleaning", coords = vector3(186.19, -851.58, 31.17) },
{ type = "cleaning", coords = vector3(185.73, -862.31, 31.28) },
{ type = "cleaning", coords = vector3(179.48, -865.32, 31.04) },
{ type = "cleaning", coords = vector3(183.68, -854.87, 31.15) },
{ type = "cleaning", coords = vector3(186.40, -846.50, 31.06) },
{ type = "gardening", coords = vector3(202.57, -854.32, 30.61) },
{ type = "gardening", coords = vector3(208.52, -856.76, 30.45) },
{ type = "gardening", coords = vector3(216.04, -859.86, 30.25) },
{ type = "gardening", coords = vector3(186.14, -869.08, 31.5) },
{ type = "gardening", coords = vector3(194.86, -867.43, 31.5) }
}
Config.Uniforms = {
prison_wear = {
male = {
['tshirt_1'] = 15, ['tshirt_2'] = 0,
['torso_1'] = 146, ['torso_2'] = 0,
['decals_1'] = 0, ['decals_2'] = 0,
['arms'] = 119, ['pants_1'] = 3,
['pants_2'] = 7, ['shoes_1'] = 12,
['shoes_2'] = 12, ['chain_1'] = 0,
['chain_2'] = 0
},
female = {
['tshirt_1'] = 3, ['tshirt_2'] = 0,
['torso_1'] = 38, ['torso_2'] = 3,
['decals_1'] = 0, ['decals_2'] = 0,
['arms'] = 120, ['pants_1'] = 3,
['pants_2'] = 15, ['shoes_1'] = 66,
['shoes_2'] = 5, ['chain_1'] = 0,
['chain_2'] = 0
}
}
}
server/main.lua
RegisterServerEvent('esx_communityservice:sendToCommunityService')
AddEventHandler('esx_communityservice:sendToCommunityService', function(target, actions_count)
local identifier = GetPlayerIdentifiers(target)[1]
local name = GetPlayerName(target)
if Config.EnableESXIdentity then name = GetCharacterName(target) end
TriggerClientEvent('chat:addMessage', -1, { args = { _U('judge'), _U('comserv_msg', name, actions_count) }, color = { 147, 196, 109 } })
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 WHERE identifier = @identifier', {
['@identifier'] = identifier,
['@actions_remaining'] = actions_count
})
else
MySQL.Async.execute('INSERT INTO communityservice (identifier, actions_remaining) VALUES (@identifier, @actions_remaining)', {
['@identifier'] = identifier,
['@actions_remaining'] = actions_count
})
end
end)
TriggerClientEvent('chat:addMessage', -1, { args = { _U('judge'), _U('comserv_msg', name, actions_count) }, color = { 147, 196, 109 } })
TriggerClientEvent('esx_policejob:unrestrain', target)
TriggerClientEvent('esx_communityservice:inCommunityService', target, actions_count)
end)