From e390a4565805b8fdb4575ef0ca8ffc3e9b5a90e2 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Fri, 22 Jun 2018 15:06:01 +0200 Subject: [PATCH] Fixed robbing without weapon #14 --- client/main.lua | 10 +++++++--- locales/br.lua | 3 +-- locales/de.lua | 1 + locales/en.lua | 1 + locales/fr.lua | 1 + locales/sv.lua | 1 + 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/client/main.lua b/client/main.lua index ed2b2c1b..e1c6e335 100644 --- a/client/main.lua +++ b/client/main.lua @@ -125,6 +125,7 @@ incircle = false Citizen.CreateThread(function() while true do + Citizen.Wait(1) local pos = GetEntityCoords(GetPlayerPed(-1), true) for k,v in pairs(Stores)do @@ -140,7 +141,11 @@ Citizen.CreateThread(function() end incircle = true if IsControlJustReleased(0, Keys['E']) then - TriggerServerEvent('esx_holdup:rob', k) + if IsPedArmed(GetPlayerPed(-1), 4) then + TriggerServerEvent('esx_holdup:rob', k) + else + ESX.ShowNotification(_U('no_threat')) + end end elseif(Vdist(pos.x, pos.y, pos.z, pos2.x, pos2.y, pos2.z) > 1.0)then incircle = false @@ -157,7 +162,6 @@ Citizen.CreateThread(function() TriggerServerEvent('esx_holdup:toofar', store) end end - - Citizen.Wait(0) end end) + \ No newline at end of file diff --git a/locales/br.lua b/locales/br.lua index 96c38cdc..6d2b2e2e 100644 --- a/locales/br.lua +++ b/locales/br.lua @@ -1,5 +1,4 @@ Locales['br'] = { - ['robbery_cancelled'] = 'O roubo será cancelado, você não ganhará nada!', ['robbery_successful'] = 'O roubo foi um sucesso. Você ganhou ~g~$', ['shop_robbery'] = 'Loja roubavel', @@ -20,5 +19,5 @@ Locales['br'] = { ['min_police'] = 'there must be at least ~b~', ['in_city'] = '~s~ policemen in town to rob.', ['robbery_already'] = '~r~Um assalto já está em andamento.', - + ['no_threat'] = 'you do not pose a threat to the store', } diff --git a/locales/de.lua b/locales/de.lua index 3c94a9b7..ffd9fe98 100644 --- a/locales/de.lua +++ b/locales/de.lua @@ -12,4 +12,5 @@ Locales['de'] = { ['robbery_cancelled_at'] = '~r~Raub abgebrochen bei: ~b~%s~s~', ['min_police'] = 'there must be at least ~b~%s cops~s~ in town to rob.', ['robbery_already'] = '~r~Ein Raub ist bereits im gange.', + ['no_threat'] = 'you do not pose a threat to the store', } diff --git a/locales/en.lua b/locales/en.lua index a8b1f3fc..7d33c724 100644 --- a/locales/en.lua +++ b/locales/en.lua @@ -12,4 +12,5 @@ Locales['en'] = { ['robbery_cancelled_at'] = '~r~The robbery at ~b~%s~s~ has been cancelled!', ['min_police'] = 'there must be at least ~b~%s cops~s~ in town to rob.', ['robbery_already'] = '~r~A robbery is already in progress.', + ['no_threat'] = 'you do not pose a threat to the store', } diff --git a/locales/fr.lua b/locales/fr.lua index 9adff5b9..5f3efced 100644 --- a/locales/fr.lua +++ b/locales/fr.lua @@ -12,4 +12,5 @@ Locales['fr'] = { ['robbery_cancelled_at'] = '~r~Braquage annulé à: ~b~%s~s~', ['min_police'] = 'il faut minimum ~b~%s policiers~s~ en ville pour braquer.', ['robbery_already'] = '~r~Un braquage est déjà en cours.', + ['no_threat'] = 'you do not pose a threat to the store', } diff --git a/locales/sv.lua b/locales/sv.lua index 2d0bc9cd..b04003c2 100644 --- a/locales/sv.lua +++ b/locales/sv.lua @@ -12,4 +12,5 @@ Locales['sv'] = { ['robbery_cancelled_at'] = '~r~Rånet~s~ vid ~b~%s~s~ har avbrutits!', ['min_police'] = 'det måste vara minst ~b~%s poliser~s~ inne för att du ska kunna ~o~råna butiker~s~.', ['robbery_already'] = '~r~Ett rån pågår redan.', + ['no_threat'] = 'du kan inte hota utan ett vapen', } \ No newline at end of file