MrEvilGamer / qb-tattooshop

qb-tattooshop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fixed Cash

jigglyblunt opened this issue · comments

hey I fixed the cash cost within qb core with notification if you want it.

Lines 24-47 need this

QBCore.Functions.CreateCallback('SmallTattoos:PurchaseTattoo', function(source, cb, tattooList, price, tattoo, tattooName)
local src = source
local Player = QBCore.Functions.GetPlayer(src)

 if Player.PlayerData.money.cash >= price then  
 	Player.Functions.RemoveMoney('cash', price)
	TriggerClientEvent('QBCore:Notify', source, "You bought a tattoo", "success")
 else
	TriggerClientEvent('QBCore:Notify', source, "not enough cash", "error")
 end
	table.insert(tattooList, tattoo)

	exports['ghmattimysql']:execute('UPDATE players SET tattoos = @tattoos WHERE citizenid = @citizenid', {
		['@tattoos'] = json.encode(tattooList),
		['@citizenid'] = Player.PlayerData.citizenid
	})

	print("You have bought the ~y~" .. tattooName .. "~s~ tattoo for ~g~$" .. price)
	cb(true)


	TriggerClientEvent('Apply:Tattoo', source, tattoo, tattooList)

end)

Thank You