Cleanup, default messages to ooc, enforce 2 space indent on locale files

This commit is contained in:
ElPumpo
2018-12-09 12:24:15 +01:00
parent 70ef871a91
commit f210796cbe
7 changed files with 74 additions and 102 deletions
+6 -3
View File
@@ -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)