Skip to content

Commit

Permalink
Inventory Update
Browse files Browse the repository at this point in the history
  • Loading branch information
GhzGarage committed May 20, 2024
1 parent 5bea1d4 commit e0fd82e
Show file tree
Hide file tree
Showing 7 changed files with 190 additions and 350 deletions.
7 changes: 4 additions & 3 deletions client/anpr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ local function HandleSpeedCam(speedCam, radarID)
sprite = 488,
color = 1,
scale = 0.9,
text = Lang:t('info.camera_speed', { radarid = radarID})
text = Lang:t('info.camera_speed', { radarid = radarID })
}
local street1, street2 = table.unpack(GetStreetNameAtCoord(coords.x, coords.y, coords.z))
TriggerServerEvent('police:server:FlaggedPlateTriggered', radarID, plate, street1, street2, blipsettings)
Expand All @@ -45,8 +45,9 @@ end
CreateThread(function()
while true do
if IsPedInAnyVehicle(PlayerPedId(), false) then
for key, value in pairs(Config.Radars) do
HandleSpeedCam(value, key)
for i = 1, #Config.Radars do
local value = Config.Radars[i]
HandleSpeedCam(value, i)
end
Wait(200)
else
Expand Down
5 changes: 1 addition & 4 deletions client/heli.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@ local toggle_rappel = 154 -- control id to rappel out of the heli. Default: IN
local toggle_spotlight = 74 -- control id to toggle the front spotlight Default: INPUT_VEH_HEADLIGHT (H)
local toggle_lock_on = 22 -- control id to lock onto a vehicle with the camera. Default is INPUT_SPRINT (spacebar)
local spotlight_state = false

-- Script starts here
local helicam = false
local fov = (fov_max + fov_min) * 0.5
local vision_state = 0 -- 0 is normal, 1 is nightmode, 2 is thermal vision

local isScanning = false
local isScanned = false
local scanValue = 0

local vehicle_detected = nil
local locked_on_vehicle = nil

-- Functions

local function IsPlayerInPolmav()
local lPed = PlayerPedId()
local vehicle = GetVehiclePedIsIn(lPed)
Expand Down
21 changes: 2 additions & 19 deletions client/interactions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,6 @@ RegisterNetEvent('police:client:PutInVehicle', function()
end
end)

RegisterNetEvent('police:client:SearchPlayer', function()
local player, distance = QBCore.Functions.GetClosestPlayer()
if player ~= -1 and distance < 2.5 then
local playerId = GetPlayerServerId(player)
TriggerServerEvent('inventory:server:OpenInventory', 'otherplayer', playerId)
TriggerServerEvent('police:server:SearchPlayer', playerId)
else
QBCore.Functions.Notify(Lang:t('error.none_nearby'), 'error')
end
end)

RegisterNetEvent('police:client:SeizeCash', function()
local player, distance = QBCore.Functions.GetClosestPlayer()
if player ~= -1 and distance < 2.5 then
Expand All @@ -117,7 +106,6 @@ RegisterNetEvent('police:client:SeizeDriverLicense', function()
end
end)


RegisterNetEvent('police:client:RobPlayer', function()
local player, distance = QBCore.Functions.GetClosestPlayer()
local ped = PlayerPedId()
Expand All @@ -134,19 +122,14 @@ RegisterNetEvent('police:client:RobPlayer', function()
animDict = 'random@shop_robbery',
anim = 'robbery_action_b',
flags = 16,
}, {}, {}, function() -- Done
}, {}, {}, function()
local plyCoords = GetEntityCoords(playerPed)
local pos = GetEntityCoords(ped)
if #(pos - plyCoords) < 2.5 then
StopAnimTask(ped, 'random@shop_robbery', 'robbery_action_b', 1.0)
TriggerServerEvent('inventory:server:OpenInventory', 'otherplayer', playerId)
TriggerEvent('inventory:server:RobPlayer', playerId)
TriggerServerEvent('police:server:RobPlayer', playerId)
else
QBCore.Functions.Notify(Lang:t('error.none_nearby'), 'error')
end
end, function() -- Cancel
StopAnimTask(ped, 'random@shop_robbery', 'robbery_action_b', 1.0)
QBCore.Functions.Notify(Lang:t('error.canceled'), 'error')
end)
end
else
Expand Down
Loading

0 comments on commit e0fd82e

Please sign in to comment.