Skip to content

Commit

Permalink
QBCore patch
Browse files Browse the repository at this point in the history
Fixed a bug when rewarding markedbills in QBCore
Bump version
  • Loading branch information
IamLation committed Jul 13, 2023
1 parent f3f8a80 commit 451c542
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Config.RegisterMinCooldown = 10 -- The minimum cooldown time for robbing registe
Config.RegisterMaxCooldown = 20 -- The maximum cooldown time for robbing registers once one has been robbed
Config.RegisterDiffuculty = { 'easy', 'easy', 'easy', 'easy', 'easy','easy', 'easy', 'easy', 'easy', 'easy' } -- The skillcheck difficulty, can be 'easy', 'medium' or 'hard' in any order and any quantity
Config.RegisterInput = { 'W', 'A', 'S', 'D' } -- The keys that are used for the skillcheck minigame, can be any keys
Config.RegisterRewardItem = 'black_money' -- The item that is rewarded upon a successful register robbery
Config.RegisterRewardItem = 'black_money' -- The item that is rewarded upon a successful register robbery (Set to "markedbills" if using QBCore)
Config.RegisterRewardRandom = true -- Set true if you want to reward a random quantity of the above item, otherwise set false
Config.RegisterRewardQuantity = 1000 -- If RegisterRewardRandom = false then this is the quantity rewarded, if true then can be ignored
Config.RegisterRewardMinQuantity = 1000 -- If RegisterRewardRandom = true then this is the minimum quantity, otherwise can be ignored
Expand All @@ -25,7 +25,7 @@ Config.CodeChance = 10 -- The percentage chance a player receives a code from th
Config.SafeMinCooldown = 10 -- The minimum cooldown time for robbing safes once one has been robbed
Config.SafeMaxCooldown = 20 -- The maximum cooldown time for robbing safes once one has been robbed
Config.MaxCodeAttempts = 3 -- The maximum amount of attempts to input the correct code to unlock safe before having to restart robbery
Config.SafeRewardItem = 'black_money' -- The item that is rewarded upon a successful safe robbery
Config.SafeRewardItem = 'black_money' -- The item that is rewarded upon a successful safe robbery (Set to "markedbills" if using QBCore)
Config.SafeRewardRandom = true -- Set true if you want to reward a random quantity of the above item, otherwise set false
Config.SafeRewardQuantity = 2000 -- If SafeRewardRandom = false then this is the quantity rewarded, if true then can be ignored
Config.SafeRewardMinQuantity = 2000 -- If SafeRewardRandom = true then this is the minimum quantity, otherwise can be ignored
Expand Down
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ lua54 'yes'

author 'iamlation'
description 'A standalone 24/7 robbery script for ESX & QBCore'
version '1.1.3'
version '1.1.4'

client_scripts {
'client/*.lua'
Expand Down
13 changes: 10 additions & 3 deletions server/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,17 @@ lib.callback.register('lation_247robbery:registerSuccessful', function(source, v
elseif Config.Framework == 'qbcore' then
local Player = QBCore.Functions.GetPlayer(source)
if Config.RegisterRewardRandom then
print(rewardQuantity)
Player.Functions.AddItem(Config.RegisterRewardItem, rewardQuantity)
local reward = {
worth = rewardQuantity
}
Player.Functions.AddItem(Config.RegisterRewardItem, 1, false, reward)
TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items[Config.RegisterRewardItem], "add")
else
Player.Functions.AddItem(Config.RegisterRewardItem, Config.RegisterRewardQuantity)
local reward = {
worth = Config.RegisterRewardQuantity
}
Player.Functions.AddItem(Config.RegisterRewardItem, 1, false, reward)
TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items[Config.RegisterRewardItem], "add")
end
else
-- Custom framework/standalone
Expand Down

0 comments on commit 451c542

Please sign in to comment.