1- local QBCore = exports [' qb-core' ]:GetCoreObject ()
21local Bail = {}
32
43-- Functions
@@ -33,14 +32,14 @@ local function saveShopInv(shop, products)
3332end
3433
3534local function deliveryPay (source , shop )
36- local Player = QBCore . Functions . GetPlayer (source )
35+ local Player = exports [ ' qb-core ' ]: GetPlayer (source )
3736 if not Player then return end
3837 local playerPed = GetPlayerPed (source )
3938 local playerCoords = GetEntityCoords (playerPed )
4039 local deliverCoords = Config .Locations [shop ].delivery
4140 local distance = # (playerCoords - vector3 (deliverCoords .x , deliverCoords .y , deliverCoords .z ))
4241 if distance > 10 then return end
43- Player .Functions . AddMoney (' bank' , Config .DeliveryPrice , ' qb-shops:deliveryPay' )
42+ Player .AddMoney (' bank' , Config .DeliveryPrice , ' qb-shops:deliveryPay' )
4443 if math.random (100 ) <= 10 then exports [' qb-inventory' ]:AddItem (source , Config .RewardItem , 1 , false , false , ' qb-shops:deliveryPay' ) end
4544end
4645
7473
7574RegisterNetEvent (' qb-shops:server:DoBail' , function (bool )
7675 local src = source
77- local Player = QBCore . Functions . GetPlayer (src )
76+ local Player = exports [ ' qb-core ' ]: GetPlayer (src )
7877 if bool then
79- if Player .Functions . RemoveMoney (' cash' , Config .TruckDeposit , ' tow-received-bail' ) then
78+ if Player .RemoveMoney (' cash' , Config .TruckDeposit , ' tow-received-bail' ) then
8079 Bail [Player .PlayerData .citizenid ] = Config .TruckDeposit
8180 TriggerClientEvent (' QBCore:Notify' , src , Lang :t (' success.paid_with_cash' , { value = Config .TruckDeposit }), ' success' )
8281 TriggerClientEvent (' qb-shops:client:SpawnVehicle' , src )
83- elseif Player .Functions . RemoveMoney (' bank' , Config .TruckDeposit , ' tow-received-bail' ) then
82+ elseif Player .RemoveMoney (' bank' , Config .TruckDeposit , ' tow-received-bail' ) then
8483 Bail [Player .PlayerData .citizenid ] = Config .TruckDeposit
8584 TriggerClientEvent (' QBCore:Notify' , src , Lang :t (' success.paid_with_bank' , { value = Config .TruckDeposit }), ' success' )
8685 TriggerClientEvent (' qb-shops:client:SpawnVehicle' , src )
@@ -89,7 +88,7 @@ RegisterNetEvent('qb-shops:server:DoBail', function(bool)
8988 end
9089 else
9190 if Bail [Player .PlayerData .citizenid ] then
92- Player .Functions . AddMoney (' cash' , Bail [Player .PlayerData .citizenid ], ' trucker-bail-paid' )
91+ Player .AddMoney (' cash' , Bail [Player .PlayerData .citizenid ], ' trucker-bail-paid' )
9392 Bail [Player .PlayerData .citizenid ] = nil
9493 TriggerClientEvent (' QBCore:Notify' , src , Lang :t (' success.refund_to_cash' , { value = Config .TruckDeposit }), ' success' )
9594 end
@@ -103,13 +102,13 @@ RegisterNetEvent('qb-shops:server:PaySlip', function(drops)
103102 local coords = Config .DeliveryLocations [' main' ].coords
104103 local distance = # (playerCoords - vector3 (coords .x , coords .y , coords .z ))
105104 if distance > 10 then return end
106- local Player = QBCore . Functions . GetPlayer (src )
105+ local Player = exports [ ' qb-core ' ]: GetPlayer (src )
107106 if not Player then return end
108107 local completedDrops = tonumber (drops )
109108 if not drops then return end
110109 local payment = Config .DeliveryPrice * completedDrops
111- Player .Functions . AddMoney (' bank' , payment , ' trucker-salary' )
112- Player .Functions . AddRep (' delivery' , completedDrops )
110+ Player .AddMoney (' bank' , payment , ' trucker-salary' )
111+ Player .AddRep (' delivery' , completedDrops )
113112 TriggerClientEvent (' QBCore:Notify' , src , Lang :t (' success.you_earned' , { value = payment }), ' success' )
114113end )
115114
@@ -120,7 +119,7 @@ RegisterNetEvent('qb-shops:server:openShop', function(data)
120119 local shopName = data .shop
121120 local shopData = Config .Locations [shopName ]
122121 if not shopData then return end
123- local Player = QBCore . Functions . GetPlayer (src )
122+ local Player = exports [ ' qb-core ' ]: GetPlayer (src )
124123 if not Player then return end
125124 local playerData = Player .PlayerData
126125 local products = shopData .products
0 commit comments