RegisterNetEvent('envanter-adam-soy')
AddEventHandler('envanter-adam-soy', function()
local player, distance = ESX.Game.GetClosestPlayer()
local ped = PlayerPedId()
if player ~= -1 and distance < 3 then
local playerPed = GetPlayerPed(player)
local playerId = GetPlayerServerId(player)
if IsEntityPlayingAnim(ped, 'dead', 'dead_a', 3) and not IsEntityPlayingAnim(ped, "mp_arresting", "idle", 49) then
DisableAllControlActions(false)
local plyCoords = GetEntityCoords(playerPed)
local pos = GetEntityCoords(ped)
local dist = #(vector3(pos.x, pos.y, pos.z) - vector3(plyCoords.x, plyCoords.y, plyCoords.z))
if dist < 3 then
StopAnimTask(ped, "random@shop_robbery", "robbery_action_b", 1.0)
TriggerServerEvent("inventory:server:OpenInventory", "otherplayer", playerId)
DisableAllControlActions(false)
else
DisableAllControlActions(false)
TriggerEvent('noification', "Yakında ölü birisi yok.", 2, 3000)
end
end
else
TriggerEvent('noification', "Yakında birisi yok.", 2, 3000)
end
end)