Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates #7

Merged
merged 34 commits into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
cd37bcf
Update config.lua
DevX32 Jul 28, 2023
06cdadd
Update main.lua
DevX32 Sep 3, 2023
af52cf0
Update main.lua
DevX32 Sep 3, 2023
609abd7
Merge branch 'Qbox-project:main' into main
DevX32 Sep 3, 2023
4183b72
Update README.md
DevX32 Sep 3, 2023
fe44700
Update fxmanifest.lua
DevX32 Sep 3, 2023
1faa9b9
Update config.lua
DevX32 Sep 6, 2023
216bd61
Update config.lua
DevX32 Sep 6, 2023
d576af7
Update fxmanifest.lua
DevX32 Sep 6, 2023
59c69cf
Update config.lua
DevX32 Sep 12, 2023
c723935
Update README.md
DevX32 Sep 12, 2023
98a26e8
Update README.md
DevX32 Sep 12, 2023
3b84bfa
Merge branch 'Qbox-project:main' into main
DevX32 Sep 12, 2023
e6a3471
Update main.lua
DevX32 Sep 15, 2023
fbb73d2
Update main.lua
DevX32 Sep 15, 2023
b8b859b
Update main.lua
DevX32 Sep 15, 2023
e05e9dc
Update fxmanifest.lua
DevX32 Sep 15, 2023
1938f0c
Update main.lua
DevX32 Sep 15, 2023
5cb41cc
Update config.lua
DevX32 Sep 15, 2023
10531b6
Update main.lua
DevX32 Sep 15, 2023
5377b92
Update main.lua
DevX32 Sep 15, 2023
2feb072
Update main.lua
DevX32 Sep 15, 2023
908ad8f
Update main.lua
DevX32 Sep 15, 2023
e48a5d4
Update main.lua
DevX32 Sep 15, 2023
b797d0e
Update main.lua
DevX32 Sep 15, 2023
8ac1768
Update main.lua
DevX32 Sep 15, 2023
0216f01
Update fxmanifest.lua
DevX32 Sep 16, 2023
3a27553
Update main.lua
DevX32 Sep 16, 2023
cacc8ba
Update main.lua
DevX32 Sep 16, 2023
c666382
Update main.lua
DevX32 Sep 16, 2023
6f2329f
Update main.lua
DevX32 Sep 17, 2023
462e63a
correct callback
DevX32 Sep 17, 2023
1520fdd
Update server/main.lua
DevX32 Sep 17, 2023
27fd08c
Merge branch 'main' into main
Manason Sep 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ function GiveKeys(id, plate)
end

function GetKeys()
QBCore.Functions.TriggerCallback('qb-vehiclekeys:server:GetVehicleKeys', function(keysList)
KeysList = keysList
lib.callback('qbx-vehiclekeys:server:getVehicleKeys', function(keysList)
KeysList = keysList
end)
end

Expand Down Expand Up @@ -312,7 +312,6 @@ function ToggleVehicleLocks(veh)
TaskPlayAnim(cache.ped, 'anim@mp_player_intmenu@key_fob@', 'fob_click', 3.0, 3.0, -1, 49, 0, false, false, false)

TriggerServerEvent("InteractSound_SV:PlayWithinDistance", 5, "lock", 0.3)

NetworkRequestControlOfEntity(veh)
if vehLockStatus == 1 then
TriggerServerEvent('qb-vehiclekeys:server:setVehLockState', NetworkGetNetworkIdFromEntity(veh), 2)
Expand Down Expand Up @@ -382,8 +381,17 @@ function LockpickDoor(isAdvanced)
if GetVehicleDoorLockStatus(vehicle) <= 0 then return end

usingAdvanced = isAdvanced
Config.LockPickDoorEvent()
end
lib.requestAnimDict('veh@break_in@0h@p_m_one@')
TaskPlayAnim(cache.ped, 'veh@break_in@0h@p_m_one@', "low_force_entry_ds", 3.0, 3.0, -1, 16, 0, 0, 0, 0)
local success = lib.skillCheck({'easy', 'easy', {areaSize = 60, speedMultiplier = 1}, 'medium'}, {'1', '2', '3', '4'})
if success then
LockpickFinishCallback(success)
else
AttemptPoliceAlert('carjack')
TriggerServerEvent('hud:server:GainStress', math.random(1, 4))
TriggerEvent('QBCore:Notify', 'You failed to lockpick.', 'error')
end
end

function LockpickFinishCallback(success)
local vehicle = QBCore.Functions.GetClosestVehicle()
Expand Down
3 changes: 0 additions & 3 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ Config.LockNPCParkedCars = true -- Lock state for NPC parked cars [true = locked
-- Lockpick Settings
Config.RemoveLockpickNormal = 0.5 -- Chance to remove lockpick on fail
Config.RemoveLockpickAdvanced = 0.2 -- Chance to remove advanced lockpick on fail
Config.LockPickDoorEvent = function() -- This function is called when a player attempts to lock pick a vehicle
TriggerEvent('qb-lockpick:client:openLockpick', LockpickFinishCallback)
end

-- Carjack Settings
Config.CarJackEnable = true -- True allows for the ability to car jack peds.
Expand Down
10 changes: 4 additions & 6 deletions fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
fx_version 'cerulean'
game 'gta5'

description 'https://github.com/QBCore-Remastered'
version '1.0.1'
lua54 'yes'
description 'https://github.com/Qbox-project'
version '1.0.0'

shared_scripts {
'@qb-core/shared/locale.lua',
'@qbx-core/shared/locale.lua',
'locales/en.lua',
'locales/*.lua',
'@ox_lib/init.lua',
'config.lua',
}
client_script 'client/main.lua'
server_script 'server/main.lua'

lua54 'yes'
4 changes: 2 additions & 2 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ RegisterNetEvent('qb-vehiclekeys:server:setVehLockState', function(vehNetId, sta
SetVehicleDoorsLocked(NetworkGetEntityFromNetworkId(vehNetId), state)
end)

QBCore.Functions.CreateCallback('qb-vehiclekeys:server:GetVehicleKeys', function(source, cb)
lib.callback.register('qbx-vehiclekeys:server:getVehicleKeys', function(source)
local citizenid = QBCore.Functions.GetPlayer(source).PlayerData.citizenid
local keysList = {}
for plate, citizenids in pairs (VehicleList) do
if citizenids[citizenid] then
keysList[plate] = true
end
end
cb(keysList)
return keysList
end)

-----------------------
Expand Down
Loading