mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 10:18:54 +00:00
Cleanup, default messages to ooc, enforce 2 space indent on locale files
This commit is contained in:
+6
-3
@@ -1,11 +1,14 @@
|
||||
RegisterNetEvent('esx_rpchat:sendProximityMessage')
|
||||
AddEventHandler('esx_rpchat:sendProximityMessage', function(id, title, message, color)
|
||||
AddEventHandler('esx_rpchat:sendProximityMessage', function(playerId, title, message, color)
|
||||
local source = PlayerId()
|
||||
local target = GetPlayerFromServerId(id)
|
||||
local target = GetPlayerFromServerId(playerId)
|
||||
|
||||
local sourcePed, targetPed = PlayerPedId(), GetPlayerPed(target)
|
||||
local sourceCoords, targetCoords = GetEntityCoords(sourcePed), GetEntityCoords(targetPed)
|
||||
|
||||
if target == source then
|
||||
TriggerEvent('chat:addMessage', { args = { title, message }, color = color })
|
||||
elseif GetDistanceBetweenCoords(GetEntityCoords(GetPlayerPed(source)), GetEntityCoords(GetPlayerPed(target)), true) < 19 then
|
||||
elseif GetDistanceBetweenCoords(sourceCoords, targetCoords, true) < 20 then
|
||||
TriggerEvent('chat:addMessage', { args = { title, message }, color = color })
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user