RegisterNUICallback("GiveItem", function(data, cb)
local player, distance = ESX.Game.GetClosestPlayer()
if player ~= -1 and distance < 2.5 then
local playerPed = GetPlayerPed(player)
local playerId = GetPlayerServerId(player)
local plyCoords = GetEntityCoords(playerPed)
local pos = GetEntityCoords(GetPlayerPed(-1))
local dist = GetDistanceBetweenCoords(pos.x, pos.y, pos.z, plyCoords.x, plyCoords.y, plyCoords.z, true)
if dist < 2.5 and then
SetCurrentPedWeapon(PlayerPedId(),'WEAPON_UNARMED',true)
TriggerServerEvent("inventory:server:GiveItem", playerId, data.inventory, data.item, data.count)
else
exports['mythic_notify']
oHudText('error', 'Yakınlarda kimse yok!')
end
else
exports['mythic_notify']
oHudText('error', 'Yakınlarda kimse yok!')
end
end) bunu deneyebilirsin