Need Help with proximity chat

The problem is when i type /me hello this happens and everyone can see it on the server

client lua

function Display(mePlayer, text, offset, isme, source, getIdentity)
	local displaying = true
	
	if ChatOn then
        local coordsMe = GetEntityCoords(GetPlayerPed(mePlayer), false)
        local coords = GetEntityCoords(PlayerPedId(), false)
        local dist = Vdist2(coordsMe, coords)
		local myId = PlayerId(source)
        if dist < 2500 then
			if isme then
			TriggerServerEvent('3drp:wiadomosc', text, isme, mePlayer, getIdentity, offset)
			else
			TriggerServerEvent('3drp:wiadomosc', text, isme, mePlayer, getIdentity, offset)
			end
        end
    end
	
	Citizen.CreateThread(function()
		Wait(time)
		displaying = false
    end)
	
	Citizen.CreateThread(function()
        nbrDisplaying = nbrDisplaying + 1
        print(nbrDisplaying)
        while displaying do
            Wait(0)
            local coordsMe = GetEntityCoords(GetPlayerPed(mePlayer), false)
            local coords = GetEntityCoords(PlayerPedId(), false)
            local dist = Vdist2(coordsMe, coords)
            if dist < 2500 then
                DrawText3D(coordsMe['x'], coordsMe['y'], coordsMe['z']+offset, text, isme)
            end
        end
        nbrDisplaying = nbrDisplaying - 1
    end)
	
end

server lua

function getIdentity(source)
	local identifier = GetPlayerIdentifiers(source)[1]
	local result = MySQL.Sync.fetchAll("SELECT * FROM users WHERE identifier = @identifier", {['@identifier'] = identifier})
	if result[1] ~= nil then
		local identity = result[1]

		return {
			identifier = identity['identifier'],
			firstname = identity['firstname'],
			lastname = identity['lastname'],
			dateofbirth = identity['dateofbirth'],
			sex = identity['sex'],
			height = identity['height']
			
		}
	else
		return nil
	end
end

RegisterServerEvent('3drp:wiadomosc')
AddEventHandler('3drp:wiadomosc', function(text, isme, mePlayer, getIdentity, offset)
    TriggerClientEvent('chat:addMessage', -1, {
        template = '<div style="padding: 0.5vw;  margin: 0.5vw; background-color: rgba(127, 0, 225, 0.6); border-radius: 3px;"><i class="fas fa-comment-dots"style="font-size:15px;color:lime"></i>&ensp;<i><b><font size="3" color="#FFFF00">{0}:</font></b></i>&ensp;<b><i><font color="lime">{1}</font></i></b></div>',
        args = { source, text }
    })
end)

RegisterServerEvent('3drp:shareDisplay')
AddEventHandler('3drp:shareDisplay', function(text, isme)
	TriggerClientEvent('3drp:triggerDisplay', -1, text, source, isme)
end)

Refff

refff

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.