Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RegisterNetEvent('sl-police:client:steal:closest')
- AddEventHandler('sl-police:client:steal:closest', function()
- local player, distance = SL.Functions.GetClosestPlayer()
- if player ~= -1 and distance < 2.5 then
- local playerPed = GetPlayerPed(player)
- local playerId = GetPlayerServerId(player)
- if IsEntityPlayingAnim(playerPed, "missminuteman_1ig_2", "handsup_base", 3) or IsEntityPlayingAnim(playerPed, "missminuteman_1ig_2", "handsup_enter", 3) or IsEntityPlayingAnim(playerPed, "mp_arresting", "idle", 3) or IsTargetDead(playerId) then
- SL.Functions.Progressbar("robbing_player", "Fouille les poches..", math.random(5000, 7000), false, true, {
- disableMovement = true,
- disableCarMovement = true,
- disableMouse = false,
- disableCombat = true,
- }, {
- animDict = "random@shop_robbery",
- anim = "robbery_action_b",
- flags = 16,
- }, {}, {}, function() -- Done
- 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
- StopAnimTask(PlayerPedId(), "random@shop_robbery", "robbery_action_b", 1.0)
- TriggerServerEvent("sl-inventory:server:OpenInventory", "otherplayer", playerId)
- TriggerEvent("sl-inventory:server:RobPlayer", playerId)
- else
- StopAnimTask(PlayerPedId(), "random@shop_robbery", "robbery_action_b", 1.0)
- SL.Functions.Notify("Personne autour ! ", "error")
- end
- end, function() -- Cancel
- StopAnimTask(PlayerPedId(), "random@shop_robbery", "robbery_action_b", 1.0)
- SL.Functions.Notify("Annuler...", "error")
- end)
- end
- else
- SL.Functions.Notify("Personne autour ! ", "error")
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement