diff --git a/client.lua b/client.lua index 1e9245d..17cc445 100644 --- a/client.lua +++ b/client.lua @@ -78,6 +78,16 @@ local function onShareDisplay(text, target) if player ~= -1 or target == GetPlayerServerId(PlayerId()) then local ped = GetPlayerPed(player) displayText(ped, text) + local coords = GetEntityCoords(GetPlayerPed(-1)) + for i = 0, 64 do + if NetworkIsPlayerActive(i) then + local ped = GetPlayerPed(id) + local playerCoords = GetEntityCoords(GetPlayerPed(i)) + if(Vdist(playerCoords.x, playerCoords.y, playerCoords.z, coords.x, coords.y, coords.z) < distance)then + TriggerServerEvent('message:inDistanceZone', GetPlayerServerId(id), text) + end + end + end end end diff --git a/server.lua b/server.lua index c8df482..6426866 100644 --- a/server.lua +++ b/server.lua @@ -9,6 +9,8 @@ local lang = Languages[Config.language] local function onMeCommand(source, args) local text = "* " .. lang.prefix .. table.concat(args, " ") .. " *" TriggerClientEvent('3dme:shareDisplay', -1, text, source) + local _source = source + TriggerClientEvent('chatMessage', source, text) end -- Register the command