mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 16:23:21 +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 playerCoords = GetEntityCoords(playerPed)
|
||||||
local targetCoords = GetEntityCoords(targetPed)
|
local targetCoords = GetEntityCoords(targetPed)
|
||||||
|
|
||||||
if target == player or #(playerCoords - targetCoords) < 20 then
|
if target ~= -1 then
|
||||||
TriggerEvent('chat:addMessage', {args = {title, message}, color = color})
|
if target == player or #(playerCoords - targetCoords) < 20 then
|
||||||
|
TriggerEvent('chat:addMessage', {args = {title, message}, color = color})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user