Security HUD
System Watchdog
×
Threads Scanned
-- / --
SYS. LOAD --%
AI SHIELD ACTIVE
DMCA Policy
×

📋 DMCA Compliance

This platform and community fully complies with the Digital Millennium Copyright Act (DMCA) and international copyright laws. We take all copyright protection seriously.

🛡️ Copyright Protection

If you believe a posted item belongs to you or violates your copyright, you may file a DMCA takedown request through our official channels. Upon receiving a valid claim, the infringing content will be removed within 24 hours.

What's new
×
Fiveguard

Request QB-Core How to give players an item bag when they finished the job ?

Anonymouse

Gold Elite
Joined
Aug 12, 2021
Messages
136
Reaction score
2,204
Points
316
I am working on a script converting, And i got a script working fine for my idea but i am getting stuck,


there is now a function in

Player.Functions.AddMoney(),

And i tried to do player.function.additem(), But it gets broken instantly, Some one knows how to do this ?

--- in client.lua
TriggerServerEvent("QB-CD-cardelivery:addMoney", math.floor(math.random(destinations[destinationLocation].from, destinations[destinationLocation].to) + (extraPoints / 2.0) + level * 1000))


-- in server.lua
RegisterNetEvent("QB-CD-cardelivery:addMoney")
AddEventHandler("QB-CD-cardelivery:addMoney", function(amount)
local src = source
if payInCash then
local Player = QBCore.Functions.GetPlayer(src)
Player.Functions.AddMoney("cash", amount)
else
local Player = QBCore.Functions.GetPlayer(src)
Player.Functions.AddMoney("bank", amount)
end
end)

I cant figure it out, I am trying to make a better cocain delivery job, but cant convert this little thing getting crazy from it, Ussualy i work with esx.
 

psylen

Silver Elite
Joined
Mar 7, 2022
Messages
21
Reaction score
10
Points
156
Location
Bangladesh
bro Anonymouse can u give me the script that u done successfully? I am also trying to do add item to this car delivery script hiype-cardelivery .. can you help me to add item ?
 
Top