From 1ccceaa4ff5bc9cbb2d334a3bd3a0cd5fa1fd902 Mon Sep 17 00:00:00 2001 From: SMVampire Date: Sun, 2 May 2021 17:07:21 -0400 Subject: [PATCH] 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 --- client/main.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index 68895782..308233cb 100644 --- a/client/main.lua +++ b/client/main.lua @@ -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)