[Release] [ESX] ESX_CommunityService

Did you get it to work for ESX?

hello

i am tying /comserv on chat but says is not a valic command, how to add it for admins? cant understand where to put it thanks

Use this to register command.

I am not able to test the code here at work. So use it with caution.

RegisterCommand(“comserv”, function(src, args, raw)
if args[1] and GetPlayerName(args[1]) ~= nil and tonumber(args[2]) then
TriggerEvent(‘esx_communityservice:sendToCommunityService’, tonumber(args[1]), tonumber(args[2]))
else
TriggerClientEvent(‘chat:addMessage’, source, { args = { _U(‘system_msn’), _U(‘invalid_player_id_or_actions’) } } )
end
end,true)

RegisterCommand(“endcomserv”, function(src, args, raw)
if args[1] then
if GetPlayerName(args[1]) ~= nil then
TriggerEvent(‘esx_communityservice:endCommunityServiceCommand’, tonumber(args[1]))
else
TriggerClientEvent(‘chat:addMessage’, source, { args = { _U(‘system_msn’), _U(‘invalid_player_id’) } } )
end
else
TriggerEvent(‘esx_communityservice:endCommunityServiceCommand’, source)
end
end,true)

In theory this should be fine. Needs testing.

1 month = 1 action

i have a similar problem when the player reconnect the moths up crazy with the message “you cant escape the common serve” even if the player is doing the actions