chore(coding-style): correct indentation

This commit is contained in:
LuaDeldu
2017-11-02 00:04:36 +01:00
parent 06e2708c3b
commit ab2b32b230
8 changed files with 282 additions and 282 deletions
+71 -71
View File
@@ -5,16 +5,16 @@ local blipRobbery = nil
ESX = nil
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
while ESX == nil do
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
Citizen.Wait(0)
end
end)
function DisplayHelpText(str)
SetTextComponentFormat("STRING")
AddTextComponentString(str)
DisplayHelpTextFromStringLabel(0, 0, 1, -1)
SetTextComponentFormat("STRING")
AddTextComponentString(str)
DisplayHelpTextFromStringLabel(0, 0, 1, -1)
end
function drawTxt(x,y ,width,height,scale, text, r,g,b,a, outline)
@@ -26,8 +26,8 @@ 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
SetTextOutline()
end
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(x - width/2, y - height/2 + 0.005)
@@ -35,9 +35,9 @@ end
RegisterNetEvent('esx_holdup:currentlyrobbing')
AddEventHandler('esx_holdup:currentlyrobbing', function(robb)
holdingup = true
store = robb
secondsRemaining = 300
holdingup = true
store = robb
secondsRemaining = 300
end)
RegisterNetEvent('esx_holdup:killblip')
@@ -56,87 +56,87 @@ end)
RegisterNetEvent('esx_holdup:toofarlocal')
AddEventHandler('esx_holdup:toofarlocal', function(robb)
holdingup = false
ESX.ShowNotification(_U('robbery_cancelled'))
robbingName = ""
secondsRemaining = 0
incircle = false
holdingup = false
ESX.ShowNotification(_U('robbery_cancelled'))
robbingName = ""
secondsRemaining = 0
incircle = false
end)
RegisterNetEvent('esx_holdup:robberycomplete')
AddEventHandler('esx_holdup:robberycomplete', function(robb)
holdingup = false
ESX.ShowNotification(_U('robbery_cancelled') .. Stores[store].reward)
store = ""
secondsRemaining = 0
incircle = false
holdingup = false
ESX.ShowNotification(_U('robbery_cancelled') .. Stores[store].reward)
store = ""
secondsRemaining = 0
incircle = false
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if holdingup then
Citizen.Wait(1000)
if(secondsRemaining > 0)then
secondsRemaining = secondsRemaining - 1
end
end
end
while true do
Citizen.Wait(0)
if holdingup then
Citizen.Wait(1000)
if(secondsRemaining > 0)then
secondsRemaining = secondsRemaining - 1
end
end
end
end)
Citizen.CreateThread(function()
for k,v in pairs(Stores)do
local ve = v.position
for k,v in pairs(Stores)do
local ve = v.position
local blip = AddBlipForCoord(ve.x, ve.y, ve.z)
SetBlipSprite(blip, 156)
SetBlipScale(blip, 0.8)
SetBlipAsShortRange(blip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString(_U('shop_robbery'))
EndTextCommandSetBlipName(blip)
end
local blip = AddBlipForCoord(ve.x, ve.y, ve.z)
SetBlipSprite(blip, 156)
SetBlipScale(blip, 0.8)
SetBlipAsShortRange(blip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString(_U('shop_robbery'))
EndTextCommandSetBlipName(blip)
end
end)
incircle = false
Citizen.CreateThread(function()
while true do
local pos = GetEntityCoords(GetPlayerPed(-1), true)
while true do
local pos = GetEntityCoords(GetPlayerPed(-1), true)
for k,v in pairs(Stores)do
local pos2 = v.position
for k,v in pairs(Stores)do
local pos2 = v.position
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(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(Vdist(pos.x, pos.y, pos.z, pos2.x, pos2.y, pos2.z) < 1.0)then
if (incircle == false) then
DisplayHelpText(_U('press_to_rob') .. v.nameofstore)
end
incircle = true
if IsControlJustReleased(1, 51) then
TriggerServerEvent('esx_holdup:rob', k)
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(Vdist(pos.x, pos.y, pos.z, pos2.x, pos2.y, pos2.z) < 1.0)then
if (incircle == false) then
DisplayHelpText(_U('press_to_rob') .. v.nameofstore)
end
incircle = true
if IsControlJustReleased(1, 51) then
TriggerServerEvent('esx_holdup:rob', k)
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
if holdingup then
drawTxt(0.66, 1.44, 1.0,1.0,0.4, _U('robbery_of') .. secondsRemaining .. _U('seconds_remaining'), 255, 255, 255, 255)
drawTxt(0.66, 1.44, 1.0,1.0,0.4, _U('robbery_of') .. secondsRemaining .. _U('seconds_remaining'), 255, 255, 255, 255)
local pos2 = Stores[store].position
local pos2 = Stores[store].position
if(Vdist(pos.x, pos.y, pos.z, pos2.x, pos2.y, pos2.z) > 7.5)then
TriggerServerEvent('esx_holdup:toofar', store)
end
end
if(Vdist(pos.x, pos.y, pos.z, pos2.x, pos2.y, pos2.z) > 7.5)then
TriggerServerEvent('esx_holdup:toofar', store)
end
end
Citizen.Wait(0)
end
Citizen.Wait(0)
end
end)