RegisterNetEvent('police:client:RobPlayer')
AddEventHandler('police:client:RobPlayer', function()
local player, distance = ESX.Game.GetClosestPlayer()
targetplayer = GetPlayerFromServerId(player)
local dead = exports["esx_ambulancejob"]:GetDeath()
if not dead then
if player ~= -1 and distance < 2.5 then
local playerPed = GetPlayerPed(player)
local playerId = GetPlayerServerId(player)
if IsEntityPlayingAnim(GetPlayerPed(player), 'mp_arresting', 'idle', 3) then
local plyCoords = GetEntityCoords(playerPed)
local pos = GetEntityCoords(PlayerPedId())
local dist = GetDistanceBetweenCoords(pos.x, pos.y, pos.z, plyCoords.x, plyCoords.y, plyCoords.z, true)
if dist < 2.5 then
loadAnimDict('random@shop_robbery')
TaskPlayAnim(PlayerPedId(),'random@shop_robbery', 'robbery_action_b',5.0, 1.5, 1.0, 48, 0.0, 0, 0, 0)
StopAnimTask(PlayerPedId(), "random@shop_robbery", "robbery_action_b", 1.0)
TriggerServerEvent("inventory:server:OpenInventory", "otherplayer", playerId)
TriggerEvent("inventory:server:RobPlayer", playerId)
TriggerServerEvent("police:server:SearchPlayer", playerId)
else
TriggerEvent("notification","Yakında kimse yok")
end
elseif IsEntityPlayingAnim(GetPlayerPed(player), 'missminuteman_1ig_2', 'handsup_enter', 3) then
if PlayerData.job.name == 'police' or PlayerData.job.name == 'sheriff' then
local plyCoords = GetEntityCoords(playerPed)
local pos = GetEntityCoords(PlayerPedId())
local dist = GetDistanceBetweenCoords(pos.x, pos.y, pos.z, plyCoords.x, plyCoords.y, plyCoords.z, true)
if dist < 2.5 then
loadAnimDict('random@shop_robbery')
TaskPlayAnim(PlayerPedId(),'random@shop_robbery', 'robbery_action_b',5.0, 1.5, 1.0, 48, 0.0, 0, 0, 0)
StopAnimTask(PlayerPedId(), "random@shop_robbery", "robbery_action_b", 1.0)
TriggerServerEvent("inventory:server:OpenInventory", "otherplayer", playerId)
TriggerEvent("inventory:server:RobPlayer", playerId)
TriggerServerEvent("police:server:SearchPlayer", playerId)
else
TriggerEvent("notification","Yakında kimse yok")
end
end
else
TriggerEvent('notification','Kişi kelepçeli değil',2)
end
else
TriggerEvent("notification","Yakında kimse yok")
end
end
end)
Arayanlar İçin 1400 satırdan 1486. satıra kadar Qb-invantory client