Fix for the new es_extended + feature

Fix for the proximity BUG with the new ESX, and added feature for anonymous tweets, using the command /anontwt
This commit is contained in:
Jimmy Bassy
2020-06-28 23:12:24 +02:00
parent 83914926b2
commit d99cfff4f2
2 changed files with 21 additions and 4 deletions
+6 -2
View File
@@ -3,8 +3,10 @@ AddEventHandler('esx_rpchat:sendProximityMessage', function(playerId, title, mes
local player = PlayerId()
local target = GetPlayerFromServerId(playerId)
local playerPed, targetPed = PlayerPedId(), GetPlayerPed(target)
local playerCoords, targetCoords = GetEntityCoords(playerPed), GetEntityCoords(targetPed)
local playerPed = PlayerPedId()
local targetPed = GetPlayerPed(target)
local playerCoords = GetEntityCoords(playerPed)
local targetCoords = GetEntityCoords(targetPed)
if target == player or #(playerCoords - targetCoords) < 20 then
TriggerEvent('chat:addMessage', {args = {title, message}, color = color})
@@ -13,6 +15,7 @@ end)
Citizen.CreateThread(function()
TriggerEvent('chat:addSuggestion', '/twt', _U('twt_help'), {{name = _U('generic_argument_name'), help = _U('generic_argument_help')}})
TriggerEvent('chat:addSuggestion', '/anontwt', _U('twtanon_help'), {{name = _U('generic_argument_name'), help = _U('generic_argument_help')}})
TriggerEvent('chat:addSuggestion', '/me', _U('me_help'), {{name = _U('generic_argument_name'), help = _U('generic_argument_help')}})
TriggerEvent('chat:addSuggestion', '/do', _U('do_help'), {{name = _U('generic_argument_name'), help = _U('generic_argument_help')}})
end)
@@ -24,3 +27,4 @@ AddEventHandler('onResourceStop', function(resource)
TriggerEvent('chat:removeSuggestion', '/do')
end
end)