mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 15:01:40 +00:00
Fix Issues with Very Far Msgs Showing
Even though playerID var returns valid, sometimes GetPlayerFromServerId() fails and returns -1. This checks for that and prevents those messages from showing. Might be related to OneSync
This commit is contained in:
+4
-2
@@ -8,8 +8,10 @@ AddEventHandler('esx_rpchat:sendProximityMessage', function(playerId, title, mes
|
||||
local playerCoords = GetEntityCoords(playerPed)
|
||||
local targetCoords = GetEntityCoords(targetPed)
|
||||
|
||||
if target == player or #(playerCoords - targetCoords) < 20 then
|
||||
TriggerEvent('chat:addMessage', {args = {title, message}, color = color})
|
||||
if target ~= -1 then
|
||||
if target == player or #(playerCoords - targetCoords) < 20 then
|
||||
TriggerEvent('chat:addMessage', {args = {title, message}, color = color})
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user