Skip to content

Commit

Permalink
chore: removed unused variables and fixed indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
BubbleDK committed Aug 24, 2024
1 parent 8266786 commit f0dae4a
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 41 deletions.
14 changes: 7 additions & 7 deletions client/alerts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ local function CustomAlert(data)
code = data.code or '10-80',
offense = data.offense,
coords = {
coords.x,
coords.x,
coords.y
},
info = disptachInfo,
Expand All @@ -38,7 +38,7 @@ local function VehicleTheft()
code = '10-35',
offense = "Vehicle Theft",
coords = {
coords.x,
coords.x,
coords.y
},
info = {
Expand Down Expand Up @@ -71,7 +71,7 @@ local function Shooting()
code = '10-11',
offense = "Shooting in progress",
coords = {
coords.x,
coords.x,
coords.y
},
info = {
Expand Down Expand Up @@ -100,7 +100,7 @@ local function VehicleShooting()
code = '10-60',
offense = "Shots Fired from Vehicle",
coords = {
coords.x,
coords.x,
coords.y
},
info = {
Expand Down Expand Up @@ -141,7 +141,7 @@ local function SpeedingVehicle()
code = '10-11',
offense = "Reckless driving",
coords = {
coords.x,
coords.x,
coords.y
},
info = {
Expand Down Expand Up @@ -174,7 +174,7 @@ local function CarJacking(vehicle)
code = '10-35',
offense = "Car Jacking",
coords = {
coords.x,
coords.x,
coords.y
},
info = {
Expand Down Expand Up @@ -207,7 +207,7 @@ local function OfficerDown()
code = '10-99',
offense = "Officer Down",
coords = {
coords.x,
coords.x,
coords.y
},
info = {
Expand Down
2 changes: 0 additions & 2 deletions client/blips.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
RegisterNetEvent('mdt:addBlip', function(data)
local street1, street2 = GetStreetNameAtCoord(data.blipCoords.x, data.blipCoords.y, data.blipCoords.z)
local street1name = GetStreetNameFromHashKey(street1)
local street2name = GetStreetNameFromHashKey(street2)
local transG = 250
local blip = AddBlipForCoord(data.blipCoords.x, data.blipCoords.y, data.blipCoords.z)
local blip2 = AddBlipForCoord(data.blipCoords.x, data.blipCoords.y, data.blipCoords.z)
Expand Down
26 changes: 11 additions & 15 deletions client/camera.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
local config = require 'config'
local framework = require(('client.framework.%s'):format(config.framework))

camera = false
local cameraprop = nil
local inPrompt = false
local inTakePicture = false
local takePicture = false

local FOV_MAX = 80.0
local FOV_MIN = 5.0 -- max zoom level (smaller fov is more zoom)
Expand All @@ -20,7 +16,7 @@ local function hideHUDThisFrame()
HideHudAndRadarThisFrame()
HideHudComponentThisFrame(1)
HideHudComponentThisFrame(2)
HideHudComponentThisFrame(3)
HideHudComponentThisFrame(3)
HideHudComponentThisFrame(4)
HideHudComponentThisFrame(6)
HideHudComponentThisFrame(7)
Expand Down Expand Up @@ -81,12 +77,12 @@ function CameraLoop(data)
lib.requestAnimDict("amb@world_human_paparazzi@male@base")
TaskPlayAnim(cache.ped, "amb@world_human_paparazzi@male@base", 'base', 6.0, 3.0, -1, 49, 1.0, false, false, false)

local model = lib.requestModel(`prop_pap_camera_01`)
local cameraModel = lib.requestModel(`prop_pap_camera_01`)

if model then
if cameraModel then
local coords = GetEntityCoords(cache.ped)

cameraprop = CreateObject(model, coords.x, coords.y, coords.z + 0.2, true, true, true)
cameraprop = CreateObject(cameraModel, coords.x, coords.y, coords.z + 0.2, true, true, true)
AttachEntityToEntity(cameraprop, cache.ped, GetPedBoneIndex(cache.ped, 28422), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, true, true, false, true, 1, true)
end

Expand All @@ -110,8 +106,8 @@ function CameraLoop(data)
ClearPedTasks(cache.ped)
DisablePlayerFiring(cache.ped, false)

if cameraprop then
DeleteEntity(cameraprop)
if cameraprop then
DeleteEntity(cameraprop)
end
elseif IsControlJustPressed(1, 176) then
PlaySoundFrontend(-1, "Camera_Shoot", "Phone_Soundset_Franklin", false)
Expand All @@ -120,8 +116,8 @@ function CameraLoop(data)
if resp then
camera = false

if cameraprop then
DeleteEntity(cameraprop)
if cameraprop then
DeleteEntity(cameraprop)
end

ClearPedTasks(cache.ped)
Expand Down Expand Up @@ -158,12 +154,12 @@ function CameraLoop(data)
end

if not tablet then
local model = lib.requestModel(`prop_cs_tablet`)
local tabletModel = lib.requestModel(`prop_cs_tablet`)

if not model then return end
if not tabletModel then return end

local coords = GetEntityCoords(cache.ped)
tablet = CreateObject(model, coords.x, coords.y, coords.z, true, true, true)
tablet = CreateObject(tabletModel, coords.x, coords.y, coords.z, true, true, true)
AttachEntityToEntity(tablet, cache.ped, GetPedBoneIndex(cache.ped, 28422), 0.0, 0.0, 0.03, 0.0, 0.0, 0.0, true, true, false, true, 0, true)
end

Expand Down
2 changes: 1 addition & 1 deletion client/eventHandlers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ local function WaitTimer(name, action, ...)
end

local function isPedAWitness(witnesses, ped)
for k, v in pairs(witnesses) do
for _, v in pairs(witnesses) do
if v == ped then
return true
end
Expand Down
8 changes: 4 additions & 4 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ RegisterNetEvent(framework.setGroupEvent, function()
end
end)

RegisterNetEvent('mdt:OpenMDT', function()
openMdt()
RegisterNetEvent('mdt:OpenMDT', function()
openMdt()
end)

RegisterNetEvent('mdt:client:CloseMiniDispatch', function()
Expand Down Expand Up @@ -326,9 +326,9 @@ RegisterNUICallback('exit', function(_, cb)
end)

AddEventHandler('onResourceStop', function(resource)
if resource == cache.resource then
if resource == cache.resource then
player.unit = nil
closeMdt()
closeMdt()
end
end)

Expand Down
2 changes: 1 addition & 1 deletion config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ return {
framework = 'qbx_core', -- qb_core / qbx_core
defaultAlertsDelay = 10,
fivemanageAPIKey = '',
defaultRespondKey = 'g'
defaultRespondKey = 'g',
enableWraithPlateReader = false,
}
2 changes: 0 additions & 2 deletions server/calls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ utils.registerCallback('mdt:detachFromCall', function(source, id)
end)

utils.registerCallback('mdt:setCallUnits', function(source, data)
local officer = officers.get(source)

activeCalls[data.id].units = {}
for i = 1, #data.units do
local unitId = data.units[i]
Expand Down
4 changes: 2 additions & 2 deletions server/charges.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ local chargeCategories = {
local charges = {}

for category in pairs(chargeCategories) do
charges[category] = {}
charges[category] = {}
end

MySQL.ready(function()
Expand All @@ -29,5 +29,5 @@ MySQL.ready(function()
end)

utils.registerCallback('mdt:getAllCharges', function()
return charges
return charges
end)
8 changes: 3 additions & 5 deletions server/framework/qb_core.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
local officers = require 'server.officers'
local utils = require 'server.utils'
local config = require 'config'
local QBCore = exports['qb-core']:GetCoreObject()

local function addOfficer(playerId)
Expand Down Expand Up @@ -74,9 +72,9 @@ function qb.getAnnouncements()
local charinfo = json.decode(announcements[i].charinfo)
table.insert(result, {
id = announcements[i].id,
contents = announcements[i].contents,
citizenid = announcements[i].citizenid,
firstname = charinfo.firstname,
contents = announcements[i].contents,
citizenid = announcements[i].citizenid,
firstname = charinfo.firstname,
lastname = charinfo.lastname,
image = announcements[i].image,
createdAt = announcements[i].createdAt
Expand Down
2 changes: 0 additions & 2 deletions server/framework/qbx_core.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
local officers = require 'server.officers'
local utils = require 'server.utils'
local config = require 'config'

local function addOfficer(playerId)
if officers.get(playerId) then return end
Expand Down

0 comments on commit f0dae4a

Please sign in to comment.