mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 10:18:54 +00:00
v1.1.0: Fixed #8, camelCase enforcing, check desc
- Enforced 2 space indent on locale files - Removed incomplete br locale - Enforced camelCase - Improved translations - Code cleanup - Fixed #8 bug where timer didn't stop - Improved config file for markers - Final commit v1.1.0
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
# esx_holdup
|
||||
This resource for ESX adds stores around the island for criminals to rob!
|
||||
|
||||
### Requirements
|
||||
- [esx_policejob](https://github.com/ESX-Org/esx_policejob)
|
||||
|
||||
|
||||
+1
-3
@@ -2,12 +2,11 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
|
||||
|
||||
description 'ESX Holdup'
|
||||
|
||||
version '1.0.1'
|
||||
version '1.1.0'
|
||||
|
||||
client_scripts {
|
||||
'@es_extended/locale.lua',
|
||||
'locales/de.lua',
|
||||
'locales/br.lua',
|
||||
'locales/en.lua',
|
||||
'locales/fi.lua',
|
||||
'locales/fr.lua',
|
||||
@@ -20,7 +19,6 @@ client_scripts {
|
||||
server_scripts {
|
||||
'@es_extended/locale.lua',
|
||||
'locales/de.lua',
|
||||
'locales/br.lua',
|
||||
'locales/en.lua',
|
||||
'locales/fi.lua',
|
||||
'locales/fr.lua',
|
||||
|
||||
+45
-63
@@ -1,4 +1,4 @@
|
||||
local holdingup = false
|
||||
local holdingUp = false
|
||||
local store = ""
|
||||
local blipRobbery = nil
|
||||
ESX = nil
|
||||
@@ -22,7 +22,7 @@ Citizen.CreateThread(function()
|
||||
end
|
||||
end)
|
||||
|
||||
function drawTxt(x,y ,width,height,scale, text, r,g,b,a, outline)
|
||||
function drawTxt(x,y, width, height, scale, text, r,g,b,a, outline)
|
||||
SetTextFont(0)
|
||||
SetTextProportional(0)
|
||||
SetTextScale(scale, scale)
|
||||
@@ -31,56 +31,53 @@ function drawTxt(x,y ,width,height,scale, text, r,g,b,a, outline)
|
||||
SetTextEdge(1, 0, 0, 0, 255)
|
||||
SetTextDropShadow()
|
||||
if outline then SetTextOutline() end
|
||||
SetTextEntry("STRING")
|
||||
AddTextComponentString(text)
|
||||
DrawText(x - width/2, y - height/2 + 0.005)
|
||||
|
||||
BeginTextCommandDisplayText('STRING')
|
||||
AddTextComponentSubstringPlayerName(text)
|
||||
EndTextCommandDisplayText(x - width/2, y - height/2 + 0.005)
|
||||
end
|
||||
|
||||
RegisterNetEvent('esx_holdup:currentlyrobbing')
|
||||
AddEventHandler('esx_holdup:currentlyrobbing', function(robb)
|
||||
holdingup = true
|
||||
store = robb
|
||||
RegisterNetEvent('esx_holdup:currentlyRobbing')
|
||||
AddEventHandler('esx_holdup:currentlyRobbing', function(currentStore)
|
||||
holdingUp, store = true, currentStore
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx_holdup:killblip')
|
||||
AddEventHandler('esx_holdup:killblip', function()
|
||||
RegisterNetEvent('esx_holdup:killBlip')
|
||||
AddEventHandler('esx_holdup:killBlip', function()
|
||||
RemoveBlip(blipRobbery)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx_holdup:setblip')
|
||||
AddEventHandler('esx_holdup:setblip', function(position)
|
||||
RegisterNetEvent('esx_holdup:setBlip')
|
||||
AddEventHandler('esx_holdup:setBlip', function(position)
|
||||
blipRobbery = AddBlipForCoord(position.x, position.y, position.z)
|
||||
SetBlipSprite(blipRobbery , 161)
|
||||
SetBlipScale(blipRobbery , 2.0)
|
||||
|
||||
SetBlipSprite(blipRobbery, 161)
|
||||
SetBlipScale(blipRobbery, 2.0)
|
||||
SetBlipColour(blipRobbery, 3)
|
||||
|
||||
PulseBlip(blipRobbery)
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx_holdup:toofarlocal')
|
||||
AddEventHandler('esx_holdup:toofarlocal', function()
|
||||
holdingup = false
|
||||
RegisterNetEvent('esx_holdup:tooFar')
|
||||
AddEventHandler('esx_holdup:tooFar', function()
|
||||
holdingUp, store = false, ''
|
||||
ESX.ShowNotification(_U('robbery_cancelled'))
|
||||
robbingName = ""
|
||||
incircle = false
|
||||
end)
|
||||
|
||||
|
||||
RegisterNetEvent('esx_holdup:robberycomplete')
|
||||
AddEventHandler('esx_holdup:robberycomplete', function(award)
|
||||
holdingup = false
|
||||
RegisterNetEvent('esx_holdup:robberyComplete')
|
||||
AddEventHandler('esx_holdup:robberyComplete', function(award)
|
||||
holdingUp, store = false, ''
|
||||
ESX.ShowNotification(_U('robbery_complete', award))
|
||||
store = ""
|
||||
incircle = false
|
||||
end)
|
||||
|
||||
RegisterNetEvent('esx_holdup:startTimer')
|
||||
AddEventHandler('esx_holdup:startTimer', function()
|
||||
local timer = Stores[store].secondsRemaining
|
||||
|
||||
RegisterNetEvent('esx_holdup:starttimer')
|
||||
AddEventHandler('esx_holdup:starttimer', function()
|
||||
timer = Stores[store].secondsRemaining
|
||||
Citizen.CreateThread(function()
|
||||
while timer > 0 do
|
||||
|
||||
while timer > 0 and holdingUp do
|
||||
Citizen.Wait(1000)
|
||||
|
||||
if timer > 0 then
|
||||
timer = timer - 1
|
||||
end
|
||||
@@ -88,23 +85,16 @@ AddEventHandler('esx_holdup:starttimer', function()
|
||||
end)
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
while holdingUp do
|
||||
Citizen.Wait(0)
|
||||
if holdingup then
|
||||
drawTxt(0.66, 1.44, 1.0,1.0,0.4, _U('robbery_timer', timer), 255, 255, 255, 255)
|
||||
else
|
||||
Citizen.Wait(1000)
|
||||
end
|
||||
drawTxt(0.66, 1.44, 1.0, 1.0, 0.4, _U('robbery_timer', timer), 255, 255, 255, 255)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
for k,v in pairs(Stores) do
|
||||
local ve = v.position
|
||||
|
||||
local blip = AddBlipForCoord(ve.x, ve.y, ve.z)
|
||||
local blip = AddBlipForCoord(v.position.x, v.position.y, v.position.z)
|
||||
SetBlipSprite(blip, 156)
|
||||
SetBlipScale(blip, 0.8)
|
||||
SetBlipAsShortRange(blip, true)
|
||||
@@ -114,47 +104,39 @@ Citizen.CreateThread(function()
|
||||
EndTextCommandSetBlipName(blip)
|
||||
end
|
||||
end)
|
||||
incircle = false
|
||||
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
while true do
|
||||
Citizen.Wait(1)
|
||||
local pos = GetEntityCoords(PlayerPedId(), true)
|
||||
local playerPos = GetEntityCoords(PlayerPedId(), true)
|
||||
|
||||
for k,v in pairs(Stores)do
|
||||
local pos2 = v.position
|
||||
for k,v in pairs(Stores) do
|
||||
local storePos = v.position
|
||||
local distance = Vdist(playerPos.x, playerPos.y, playerPos.z, storePos.x, storePos.y, storePos.z)
|
||||
|
||||
if Vdist(pos.x, pos.y, pos.z, pos2.x, pos2.y, pos2.z) < 15.0 then
|
||||
if not holdingup then
|
||||
DrawMarker(1, v.position.x, v.position.y, v.position.z - 1, 0, 0, 0, 0, 0, 0, 1.0001, 1.0001, 1.5001, 1555, 0, 0,255, 0, 0, 0,0)
|
||||
if distance < Config.Marker.DrawDistance then
|
||||
if not holdingUp then
|
||||
DrawMarker(Config.Marker.Type, storePos.x, storePos.y, storePos.z - 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Config.Marker.x, Config.Marker.y, Config.Marker.z, Config.Marker.r, Config.Marker.g, Config.Marker.b, Config.Marker.a, false, false, 2, false, false, false, false)
|
||||
|
||||
if Vdist(pos.x, pos.y, pos.z, pos2.x, pos2.y, pos2.z) < 1.0 then
|
||||
if not incirle then
|
||||
ESX.ShowHelpNotification(_U('press_to_rob', v.nameofstore))
|
||||
end
|
||||
if distance < 0.5 then
|
||||
ESX.ShowHelpNotification(_U('press_to_rob', v.nameOfStore))
|
||||
|
||||
incircle = true
|
||||
if IsControlJustReleased(0, Keys['E']) then
|
||||
if IsPedArmed(PlayerPedId(), 4) then
|
||||
TriggerServerEvent('esx_holdup:rob', k)
|
||||
TriggerServerEvent('esx_holdup:robberyStarted', 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
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if holdingup then
|
||||
|
||||
local pos2 = Stores[store].position
|
||||
if Vdist(pos.x, pos.y, pos.z, pos2.x, pos2.y, pos2.z) > Config.MaxDistance then
|
||||
TriggerServerEvent('esx_holdup:toofar', store)
|
||||
if holdingUp then
|
||||
local storePos = Stores[store].position
|
||||
if Vdist(playerPos.x, playerPos.y, playerPos.z, storePos.x, storePos.y, storePos.z) > Config.MaxDistance then
|
||||
TriggerServerEvent('esx_holdup:tooFar', store)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
+28
-22
@@ -1,74 +1,80 @@
|
||||
Config = {}
|
||||
Config.Locale = 'fr'
|
||||
|
||||
Config.PoliceNumberRequired = 2
|
||||
Config.TimerBeforeNewRob = 1800 -- seconds
|
||||
Config.Marker = {
|
||||
r = 250, g = 0, b = 0, a = 100, -- red color
|
||||
x = 1.0, y = 1.0, z = 1.5, -- tiny, cylinder formed circle
|
||||
DrawDistance = 15.0, Type = 1 -- default circle type, low draw distance due to indoors area
|
||||
}
|
||||
|
||||
Config.MaxDistance = 40 -- max distance from the robbary, going any longer away from it will to cancel the robbary
|
||||
Config.GiveBlackMoney = true -- give black money? If disabled it will give cash instead.
|
||||
Config.PoliceNumberRequired = 2
|
||||
Config.TimerBeforeNewRob = 1800 -- The cooldown timer on a store after robbery was completed / canceled, in seconds
|
||||
|
||||
Config.MaxDistance = 20 -- max distance from the robbary, going any longer away from it will to cancel the robbary
|
||||
Config.GiveBlackMoney = true -- give black money? If disabled it will give cash instead
|
||||
|
||||
Stores = {
|
||||
["paleto_twentyfourseven"] = {
|
||||
position = { x = 1736.32, y = 6419.47, z = 35.03 },
|
||||
reward = math.random(5000, 35000),
|
||||
nameofstore = "24/7. (Paleto Bay)",
|
||||
nameOfStore = "24/7. (Paleto Bay)",
|
||||
secondsRemaining = 350, -- seconds
|
||||
lastrobbed = 0
|
||||
lastRobbed = 0
|
||||
},
|
||||
["sandyshores_twentyfoursever"] = {
|
||||
position = { x = 1961.24, y = 3749.46, z = 32.34 },
|
||||
reward = math.random(3000, 20000),
|
||||
nameofstore = "24/7. (Sandy Shores)",
|
||||
nameOfStore = "24/7. (Sandy Shores)",
|
||||
secondsRemaining = 200, -- seconds
|
||||
lastrobbed = 0
|
||||
lastRobbed = 0
|
||||
},
|
||||
["littleseoul_twentyfourseven"] = {
|
||||
position = { x = -709.17, y = -904.21, z = 19.21 },
|
||||
reward = math.random(3000, 20000),
|
||||
nameofstore = "24/7. (Little Seoul)",
|
||||
nameOfStore = "24/7. (Little Seoul)",
|
||||
secondsRemaining = 200, -- seconds
|
||||
lastrobbed = 0
|
||||
lastRobbed = 0
|
||||
},
|
||||
["bar_one"] = {
|
||||
position = { x = 1990.57, y = 3044.95, z = 47.21 },
|
||||
reward = math.random(5000, 35000),
|
||||
nameofstore = "Yellow Jack. (Sandy Shores)",
|
||||
nameOfStore = "Yellow Jack. (Sandy Shores)",
|
||||
secondsRemaining = 300, -- seconds
|
||||
lastrobbed = 0
|
||||
lastRobbed = 0
|
||||
},
|
||||
["ocean_liquor"] = {
|
||||
position = { x = -2959.33, y = 388.21, z = 14.00 },
|
||||
reward = math.random(3000, 30000),
|
||||
nameofstore = "Robs Liquor. (Great Ocean Highway)",
|
||||
nameOfStore = "Robs Liquor. (Great Ocean Highway)",
|
||||
secondsRemaining = 200, -- seconds
|
||||
lastrobbed = 0
|
||||
lastRobbed = 0
|
||||
},
|
||||
["rancho_liquor"] = {
|
||||
position = { x = 1126.80, y = -980.40, z = 45.41 },
|
||||
reward = math.random(3000, 50000),
|
||||
nameofstore = "Robs Liquor. (El Rancho Blvd)",
|
||||
nameOfStore = "Robs Liquor. (El Rancho Blvd)",
|
||||
secondsRemaining = 200, -- seconds
|
||||
lastrobbed = 0
|
||||
lastRobbed = 0
|
||||
},
|
||||
["sanandreas_liquor"] = {
|
||||
position = { x = -1219.85, y = -916.27, z = 11.32 },
|
||||
reward = math.random(3000, 30000),
|
||||
nameofstore = "Robs Liquor. (San Andreas Avenue)",
|
||||
nameOfStore = "Robs Liquor. (San Andreas Avenue)",
|
||||
secondsRemaining = 200, -- seconds
|
||||
lastrobbed = 0
|
||||
lastRobbed = 0
|
||||
},
|
||||
["grove_ltd"] = {
|
||||
position = { x = -43.40, y = -1749.20, z = 29.42 },
|
||||
reward = math.random(3000, 15000),
|
||||
nameofstore = "LTD Gasoline. (Grove Street)",
|
||||
nameOfStore = "LTD Gasoline. (Grove Street)",
|
||||
secondsRemaining = 200, -- seconds
|
||||
lastrobbed = 0
|
||||
lastRobbed = 0
|
||||
},
|
||||
["mirror_ltd"] = {
|
||||
position = { x = 1160.67, y = -314.40, z = 69.20 },
|
||||
reward = math.random(3000, 15000),
|
||||
nameofstore = "LTD Gasoline. (Mirror Park Boulevard)",
|
||||
nameOfStore = "LTD Gasoline. (Mirror Park Boulevard)",
|
||||
secondsRemaining = 200, -- seconds
|
||||
lastrobbed = 0
|
||||
lastRobbed = 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
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',
|
||||
['press_to_rob'] = 'Pressione ~INPUT_CONTEXT~ para roubar ~b~',
|
||||
['robbery_of'] = 'Loja roubavel: ~r~',
|
||||
['seconds_remaining'] = '~w~ segundos restantes',
|
||||
['robbery_cancelled_at'] = '~r~ Roubo cancelado em: ~b~',
|
||||
['robbery_has_cancelled'] = '~r~ O assalto foi cancelado: ~b~',
|
||||
['already_robbed'] = 'Esta loja já foi roubada. Por favor, espere: ',
|
||||
['seconds'] = 'segundos.',
|
||||
['rob_in_prog'] = '~r~ Assalto em curso em: ~b~',
|
||||
['started_to_rob'] = 'Você começou a roubar ~b~',
|
||||
['do_not_move'] = '~s~, Não se afaste!',
|
||||
['alarm_triggered'] = 'O alarme foi disparado',
|
||||
['hold_pos'] = 'Segure por 5 minutos e o dinheiro é seu!',
|
||||
['robbery_complete'] = '~r~ Roubo completo.~s~ ~h~ Corre!',
|
||||
['robbery_complete_at'] = '~r~ Roubo completo em: ~b~',
|
||||
['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',
|
||||
}
|
||||
+14
-14
@@ -1,16 +1,16 @@
|
||||
Locales['de'] = {
|
||||
['shop_robbery'] = 'ladenraub',
|
||||
['press_to_rob'] = 'drücke ~INPUT_CONTEXT~ ~o~zum ausrauben~s~ ~b~%s~s~',
|
||||
['robbery_timer'] = 'ladenraub: ~r~%s~s~ sekunden übrig!',
|
||||
['recently_robbed'] = 'dieser Laden wurde bereits ausgeraubt. Bitte warte ~y~%s~s~ sekunden!',
|
||||
['rob_in_prog'] = '~r~Raub im gange bei: ~b~%s~s~',
|
||||
['started_to_rob'] = 'du hast einen Raub gestartet ~y~%s~s~',
|
||||
['alarm_triggered'] = 'der Alarm wurde ausgelöst',
|
||||
['robbery_complete'] = '~r~Raub erfolgreich.~s~ Du ~o~hast gestohlen~s~ ~g~$%s~s~',
|
||||
['robbery_complete_at'] = '~r~Raub erfolgreich bei: ~y~%s~s~',
|
||||
['robbery_cancelled'] = 'der Raub wurde abgebrochen, du bekommst nichts!',
|
||||
['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',
|
||||
['shop_robbery'] = 'ladenraub',
|
||||
['press_to_rob'] = 'drücke ~INPUT_CONTEXT~ ~o~zum ausrauben~s~ ~b~%s~s~',
|
||||
['robbery_timer'] = 'ladenraub: ~r~%s~s~ sekunden übrig!',
|
||||
['recently_robbed'] = 'dieser Laden wurde bereits ausgeraubt. Bitte warte ~y~%s~s~ sekunden!',
|
||||
['rob_in_prog'] = '~r~Raub im gange bei: ~b~%s~s~',
|
||||
['started_to_rob'] = 'du hast einen Raub gestartet ~y~%s~s~',
|
||||
['alarm_triggered'] = 'der Alarm wurde ausgelöst',
|
||||
['robbery_complete'] = '~r~Raub erfolgreich.~s~ Du ~o~hast gestohlen~s~ ~g~$%s~s~',
|
||||
['robbery_complete_at'] = '~r~Raub erfolgreich bei: ~y~%s~s~',
|
||||
['robbery_cancelled'] = 'der Raub wurde abgebrochen, du bekommst nichts!',
|
||||
['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 keeper',
|
||||
}
|
||||
|
||||
+14
-14
@@ -1,16 +1,16 @@
|
||||
Locales['en'] = {
|
||||
['shop_robbery'] = 'shop Robbery',
|
||||
['press_to_rob'] = 'press ~INPUT_CONTEXT~ to ~o~rob~s~ ~b~%s~s~',
|
||||
['robbery_timer'] = 'store robbery: ~r~%s~s~ seconds remaning',
|
||||
['recently_robbed'] = 'this store was recently been robbed. Please wait ~y~%s~s~ seconds until you can rob again',
|
||||
['rob_in_prog'] = '~r~robbery in progress at ~b~%s~s~',
|
||||
['started_to_rob'] = 'you started to rob ~y~%s~s~',
|
||||
['alarm_triggered'] = 'the alarm has been triggered',
|
||||
['robbery_complete'] = '~r~The robbery has been successful~s~, you ~o~stole~s~ ~g~$%s~s~',
|
||||
['robbery_complete_at'] = '~r~Robbery successful at ~y~%s~s~',
|
||||
['robbery_cancelled'] = 'the robbery has been cancelled!',
|
||||
['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',
|
||||
['shop_robbery'] = 'shop Robbery',
|
||||
['press_to_rob'] = 'press ~INPUT_CONTEXT~ to ~o~rob~s~ ~b~%s~s~',
|
||||
['robbery_timer'] = 'store robbery: ~r~%s~s~ seconds remaning',
|
||||
['recently_robbed'] = 'this store was recently been robbed. Please wait ~y~%s~s~ seconds until you can rob again',
|
||||
['rob_in_prog'] = '~r~robbery in progress at ~b~%s~s~',
|
||||
['started_to_rob'] = 'you started to rob ~y~%s~s~',
|
||||
['alarm_triggered'] = 'the alarm has been triggered',
|
||||
['robbery_complete'] = '~r~The robbery has been successful~s~, you ~o~stole~s~ ~g~$%s~s~',
|
||||
['robbery_complete_at'] = '~r~Robbery successful at ~y~%s~s~',
|
||||
['robbery_cancelled'] = 'the robbery has been cancelled!',
|
||||
['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 keeper',
|
||||
}
|
||||
|
||||
@@ -12,4 +12,5 @@ Locales['fi'] = {
|
||||
['robbery_cancelled_at'] = '~r~Ryöstö kohteessa ~b~%s~s~ keskeytyi!',
|
||||
['min_police'] = 'kaupungissa pitää olla vähintää ~b~%s poliisia~s~ paikalla ryöstön aloitukseen.',
|
||||
['robbery_already'] = '~r~Ryöstö on jo menossa.',
|
||||
['no_threat'] = 'you do not pose a threat to the store keeper',
|
||||
}
|
||||
|
||||
+14
-14
@@ -1,16 +1,16 @@
|
||||
Locales['fr'] = {
|
||||
['shop_robbery'] = 'braquage magasin',
|
||||
['press_to_rob'] = 'appuyez sur ~INPUT_CONTEXT~ ~o~pour braquer~s~ ~b~%s~s~',
|
||||
['robbery_timer'] = 'braquage magasin: il reste ~r~%s~s~ secondes',
|
||||
['recently_robbed'] = 'ce magasin a déjà été braqué. Attendez ~r~%s~b~ secondes.',
|
||||
['rob_in_prog'] = '~r~Braquage en cours à: ~b~%s~s~',
|
||||
['started_to_rob'] = 'vous avez commencé à braquer ~b~%s~s~',
|
||||
['alarm_triggered'] = 'l\'alarme a été déclenchée',
|
||||
['robbery_complete'] = '~r~Braquage terminé~s~. Vous avez ~o~volé~s~ ~g~$%s~s~',
|
||||
['robbery_complete_at'] = '~r~Braquage terminé à: ~b~%s~s~',
|
||||
['robbery_cancelled'] = 'le braquage va être annulé, vous ne gagnerez rien!',
|
||||
['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',
|
||||
['shop_robbery'] = 'braquage magasin',
|
||||
['press_to_rob'] = 'appuyez sur ~INPUT_CONTEXT~ ~o~pour braquer~s~ ~b~%s~s~',
|
||||
['robbery_timer'] = 'braquage magasin: il reste ~r~%s~s~ secondes',
|
||||
['recently_robbed'] = 'ce magasin a déjà été braqué. Attendez ~r~%s~b~ secondes.',
|
||||
['rob_in_prog'] = '~r~Braquage en cours à: ~b~%s~s~',
|
||||
['started_to_rob'] = 'vous avez commencé à braquer ~b~%s~s~',
|
||||
['alarm_triggered'] = 'l\'alarme a été déclenchée',
|
||||
['robbery_complete'] = '~r~Braquage terminé~s~. Vous avez ~o~volé~s~ ~g~$%s~s~',
|
||||
['robbery_complete_at'] = '~r~Braquage terminé à: ~b~%s~s~',
|
||||
['robbery_cancelled'] = 'le braquage va être annulé, vous ne gagnerez rien!',
|
||||
['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 keeper',
|
||||
}
|
||||
|
||||
+14
-14
@@ -1,16 +1,16 @@
|
||||
Locales['pl'] = {
|
||||
['shop_robbery'] = 'napad Na Sklep',
|
||||
['press_to_rob'] = 'Wciśnij ~INPUT_CONTEXT~ aby ~o~napaść~s~ na ~b~%s~s~',
|
||||
['robbery_timer'] = 'napad na sklep: ~r~%s~s~ sekund do końca',
|
||||
['recently_robbed'] = 'ten sklep niedawno został obrabowany. Proszę poczekać ~y~%s~s~ sekund przed kolejnym napadem',
|
||||
['rob_in_prog'] = '~r~napad w toku w ~b~%s~s~',
|
||||
['started_to_rob'] = 'rozpoczałeś/aś napad ~y~%s~s~',
|
||||
['alarm_triggered'] = 'alarm został włączony',
|
||||
['robbery_complete'] = '~r~Napad udany~s~, ~o~obrabowałeś/aś~s~ ~g~$%s~s~',
|
||||
['robbery_complete_at'] = '~r~Napad udany w ~y~%s~s~',
|
||||
['robbery_cancelled'] = 'napad został anulowany!',
|
||||
['robbery_cancelled_at'] = '~r~Napad w ~b~%s~s~ został anulowany!',
|
||||
['min_police'] = 'minimalnie musi być ~b~%s policjantów~s~ w mieście aby obrabować.',
|
||||
['robbery_already'] = '~r~Napad jest już w toku.',
|
||||
['no_threat'] = 'nie tworzysz zagrożenia dla tego sklepu',
|
||||
['shop_robbery'] = 'napad Na Sklep',
|
||||
['press_to_rob'] = 'Wciśnij ~INPUT_CONTEXT~ aby ~o~napaść~s~ na ~b~%s~s~',
|
||||
['robbery_timer'] = 'napad na sklep: ~r~%s~s~ sekund do końca',
|
||||
['recently_robbed'] = 'ten sklep niedawno został obrabowany. Proszę poczekać ~y~%s~s~ sekund przed kolejnym napadem',
|
||||
['rob_in_prog'] = '~r~napad w toku w ~b~%s~s~',
|
||||
['started_to_rob'] = 'rozpoczałeś/aś napad ~y~%s~s~',
|
||||
['alarm_triggered'] = 'alarm został włączony',
|
||||
['robbery_complete'] = '~r~Napad udany~s~, ~o~obrabowałeś/aś~s~ ~g~$%s~s~',
|
||||
['robbery_complete_at'] = '~r~Napad udany w ~y~%s~s~',
|
||||
['robbery_cancelled'] = 'napad został anulowany!',
|
||||
['robbery_cancelled_at'] = '~r~Napad w ~b~%s~s~ został anulowany!',
|
||||
['min_police'] = 'minimalnie musi być ~b~%s policjantów~s~ w mieście aby obrabować.',
|
||||
['robbery_already'] = '~r~Napad jest już w toku.',
|
||||
['no_threat'] = 'nie tworzysz zagrożenia dla tego sklepu',
|
||||
}
|
||||
|
||||
+14
-14
@@ -1,16 +1,16 @@
|
||||
Locales['sv'] = {
|
||||
['shop_robbery'] = 'butikrån',
|
||||
['press_to_rob'] = 'tryck ~INPUT_CONTEXT~ för att ~o~råna~s~ ~b~%s~s~',
|
||||
['robbery_timer'] = 'butiksrån: ~r~%s~s~ sekunder kvarstår',
|
||||
['recently_robbed'] = 'denna butik har nyligen rånats, du måste vänta ~y~%s~s~ sekunder!',
|
||||
['rob_in_prog'] = '~r~Det är ett pågående rån vid ~b~%s~s~',
|
||||
['started_to_rob'] = 'du började att råna ~y~%s~s~, gå inte för långt från butiken!',
|
||||
['alarm_triggered'] = '~o~Larmet har utlösts~s~',
|
||||
['robbery_complete'] = '~r~Rånet är avklarat~s~, du stal ~r~%s SEK~s~!',
|
||||
['robbery_complete_at'] = '~r~Ett rån lyckades~s~ vid ~y~%s~s~',
|
||||
['robbery_cancelled'] = 'rånet har avbrutits!',
|
||||
['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',
|
||||
['shop_robbery'] = 'butikrån',
|
||||
['press_to_rob'] = 'tryck ~INPUT_CONTEXT~ för att ~o~råna~s~ ~b~%s~s~',
|
||||
['robbery_timer'] = 'butiksrån: ~r~%s~s~ sekunder kvarstår',
|
||||
['recently_robbed'] = 'denna butik har nyligen rånats, du måste vänta ~y~%s~s~ sekunder!',
|
||||
['rob_in_prog'] = '~r~Det är ett pågående rån vid ~b~%s~s~',
|
||||
['started_to_rob'] = 'du började att råna ~y~%s~s~, gå inte för långt från butiken!',
|
||||
['alarm_triggered'] = '~o~Larmet har utlösts~s~',
|
||||
['robbery_complete'] = '~r~Rånet är avklarat~s~, du stal ~r~%s SEK~s~!',
|
||||
['robbery_complete_at'] = '~r~Ett rån lyckades~s~ vid ~y~%s~s~',
|
||||
['robbery_cancelled'] = 'rånet avbröts!',
|
||||
['robbery_cancelled_at'] = '~r~Rånet~s~ vid ~b~%s~s~ avbröts!',
|
||||
['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',
|
||||
}
|
||||
+31
-30
@@ -4,37 +4,39 @@ ESX = nil
|
||||
|
||||
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
|
||||
|
||||
RegisterServerEvent('esx_holdup:toofar')
|
||||
AddEventHandler('esx_holdup:toofar', function(robb)
|
||||
RegisterServerEvent('esx_holdup:tooFar')
|
||||
AddEventHandler('esx_holdup:tooFar', function(currentStore)
|
||||
local _source = source
|
||||
local xPlayers = ESX.GetPlayers()
|
||||
rob = false
|
||||
|
||||
for i=1, #xPlayers, 1 do
|
||||
local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
|
||||
|
||||
if xPlayer.job.name == 'police' then
|
||||
TriggerClientEvent('esx:showNotification', xPlayers[i], _U('robbery_cancelled_at', Stores[robb].nameofstore))
|
||||
TriggerClientEvent('esx_holdup:killblip', xPlayers[i])
|
||||
TriggerClientEvent('esx:showNotification', xPlayers[i], _U('robbery_cancelled_at', Stores[currentStore].nameOfStore))
|
||||
TriggerClientEvent('esx_holdup:killBlip', xPlayers[i])
|
||||
end
|
||||
end
|
||||
|
||||
if robbers[_source] then
|
||||
TriggerClientEvent('esx_holdup:toofarlocal', _source)
|
||||
TriggerClientEvent('esx_holdup:tooFar', _source)
|
||||
robbers[_source] = nil
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('robbery_cancelled_at', Stores[robb].nameofstore))
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('robbery_cancelled_at', Stores[currentStore].nameOfStore))
|
||||
end
|
||||
end)
|
||||
|
||||
RegisterServerEvent('esx_holdup:rob')
|
||||
AddEventHandler('esx_holdup:rob', function(robb)
|
||||
RegisterServerEvent('esx_holdup:robberyStarted')
|
||||
AddEventHandler('esx_holdup:robberyStarted', function(currentStore)
|
||||
local _source = source
|
||||
local xPlayer = ESX.GetPlayerFromId(_source)
|
||||
local xPlayers = ESX.GetPlayers()
|
||||
|
||||
if Stores[robb] then
|
||||
local store = Stores[robb]
|
||||
if Stores[currentStore] then
|
||||
local store = Stores[currentStore]
|
||||
|
||||
if (os.time() - store.lastrobbed) < Config.TimerBeforeNewRob and store.lastrobbed ~= 0 then
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('recently_robbed', Config.TimerBeforeNewRob - (os.time() - store.lastrobbed)))
|
||||
if (os.time() - store.lastRobbed) < Config.TimerBeforeNewRob and store.lastRobbed ~= 0 then
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('recently_robbed', Config.TimerBeforeNewRob - (os.time() - store.lastRobbed)))
|
||||
return
|
||||
end
|
||||
|
||||
@@ -53,40 +55,39 @@ AddEventHandler('esx_holdup:rob', function(robb)
|
||||
for i=1, #xPlayers, 1 do
|
||||
local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
|
||||
if xPlayer.job.name == 'police' then
|
||||
TriggerClientEvent('esx:showNotification', xPlayers[i], _U('rob_in_prog', store.nameofstore))
|
||||
TriggerClientEvent('esx_holdup:setblip', xPlayers[i], Stores[robb].position)
|
||||
TriggerClientEvent('esx:showNotification', xPlayers[i], _U('rob_in_prog', store.nameOfStore))
|
||||
TriggerClientEvent('esx_holdup:setBlip', xPlayers[i], Stores[currentStore].position)
|
||||
end
|
||||
end
|
||||
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('started_to_rob', store.nameofstore))
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('started_to_rob', store.nameOfStore))
|
||||
TriggerClientEvent('esx:showNotification', _source, _U('alarm_triggered'))
|
||||
|
||||
TriggerClientEvent('esx_holdup:currentlyrobbing', _source, robb)
|
||||
TriggerClientEvent('esx_holdup:starttimer', _source)
|
||||
TriggerClientEvent('esx_holdup:currentlyRobbing', _source, currentStore)
|
||||
TriggerClientEvent('esx_holdup:startTimer', _source)
|
||||
|
||||
Stores[robb].lastrobbed = os.time()
|
||||
robbers[_source] = robb
|
||||
local savedSource = _source
|
||||
SetTimeout(store.secondsRemaining * 1000, function()
|
||||
Stores[currentStore].lastRobbed = os.time()
|
||||
robbers[_source] = currentStore
|
||||
|
||||
if robbers[savedSource] then
|
||||
SetTimeout(store.secondsRemaining * 1000, function()
|
||||
if robbers[_source] then
|
||||
rob = false
|
||||
if xPlayer then
|
||||
local award = store.reward
|
||||
TriggerClientEvent('esx_holdup:robberycomplete', savedSource, award)
|
||||
TriggerClientEvent('esx_holdup:robberyComplete', _source, store.reward)
|
||||
|
||||
if Config.GiveBlackMoney then
|
||||
xPlayer.addAccountMoney('black_money', award)
|
||||
xPlayer.addAccountMoney('black_money', store.reward)
|
||||
else
|
||||
xPlayer.addMoney(award)
|
||||
xPlayer.addMoney(store.reward)
|
||||
end
|
||||
|
||||
local xPlayers = ESX.GetPlayers()
|
||||
local xPlayers, xPlayer = ESX.GetPlayers(), nil
|
||||
for i=1, #xPlayers, 1 do
|
||||
local xPlayer = ESX.GetPlayerFromId(xPlayers[i])
|
||||
xPlayer = ESX.GetPlayerFromId(xPlayers[i])
|
||||
|
||||
if xPlayer.job.name == 'police' then
|
||||
TriggerClientEvent('esx:showNotification', xPlayers[i], _U('robbery_complete_at', store.nameofstore))
|
||||
TriggerClientEvent('esx_holdup:killblip', xPlayers[i])
|
||||
TriggerClientEvent('esx:showNotification', xPlayers[i], _U('robbery_complete_at', store.nameOfStore))
|
||||
TriggerClientEvent('esx_holdup:killBlip', xPlayers[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user