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.
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.