RegisterServerEvent('policeRadioMessage')
AddEventHandler('policeRadioMessage', function(position, message)
local players = GetPlayers()
for _, player in ipairs(players) do
local playerPosition = GetPlayerPosition(player)
local distance = GetDistance(playerPosition, position)
if IsPlayerPolice(player) and distance < 10.0 then
TriggerClientEvent('playPoliceRadioMessage', player, message)
end
end
end)
function GetPlayers()
local players = {}
for _, player in ipairs(GetPlayers()) do
table.insert(players, player)
end
return players
end
function IsPlayerPolice(player)
function GetPlayerPosition(player)
end
function GetDistance(position1, position2)
Bunun bi kaç kod yazdım bilgin var ise geliştirip istediğin şeyi elde edebilirsin