RPChat /me and /do breaks its proximity for some players

image

I am nowhere near this person and the /me is either broken or not working.
main.lua (2.4 KB)
client.lua ^^^^

main.lua (1.7 KB)
server.lua^^^^

Im not sure if onesync bugs it out or not, or if its just not working for another reason.

It’s mostly because you are probably using onesync infinity, change it to legacy to fix the proximity issue or rewrite the functions to get players coords from serverside and trigger it to the client.

I’ll give legacy a shot to see if it fixes my issue.

Here is what i have ( basically replacing ‘chatMessage’ with ‘chat:addMessage’ so OneSync compatible)

RegisterNetEvent('esx_rpchat:sendProximityMessageMe')  -- 30meters
AddEventHandler('esx_rpchat:sendProximityMessageMe', function(playerId, title, message, color)
	local player = PlayerId()
	local target = GetPlayerFromServerId(playerId)

	local playerPed = PlayerPedId()
	local targetPed = GetPlayerPed(target)
	local playerCoords = GetEntityCoords(playerPed)
	local targetCoords = GetEntityCoords(targetPed)

	if target ~= -1 then
		if target == player or #(playerCoords - targetCoords) < 30 then
			TriggerEvent('chat:addMessage', {args = {"^3"..title.." "..message}})
		end
	end
end)
1 Like