[Release] KGV-Blackjack

you can sent this for me if this esx ?
please

if this esx you can send me this please ?

Can someone link the correct casino to use? I tried using the one from the link in the post but that already has its own game and this script doesnt work unless that is running but that creates two games. I feel like I am confusing myself lol


Having this issue, also whenever i do get it working, it doesnt take the chips out of the inventory.
Any ideas?

which must be modified to be used with an item such as chips in ESX. Help me please

none, there’s a resource you start alongside the core one

Any help would be appreciated. Not sure what to do about this error.

Error loading script coords.lua in resource kgv-blackjack: @kgv-blackjack/coords.lua:60: bad argument #1 to ‘pairs’ (table expected, got nil)

customTables is defined right above, so that shouldn’t happen. did you modify the code?

No modifications at all, I just noticed the error, but everything seems to be working. Cant figure it out. Might have to remove it all and do a fresh install

Hi im trying to lower the " bettingnums" to make bet like : 1 $ 2 $ etc… not 10 20 30 40…
But when I do that and then In game i try to bet it tell me I don’t have enough money I don’t know why… help :frowning:

Hello. I installed everything correctly and it works great…

Except that two of the table+Croupiers are in the meeting point in the middle of Los Santos… Can someone help me with that? I can’t seem to find why this is happening as I did not change any coords in the scripts, thanks in advance.

Here is a screenshot (Let’s say I laughed when I saw that!)

due to the way money-related functions are hooked, you have to make sure your money resource (probably the esx one?) is started after kgv-blackjack.

Some pre-defined default ‘custom tables’ are there, you can remove them.

really in need of an essentialmode version, what can i do?

to anyone using essentialmode without esx, download the esx module and replace the code with this
it worked for me

function SetExports()
    exports["kgv-blackjack"]:SetGetChipsCallback(function(source)
        local cash = 0
		TriggerEvent('es:getPlayerFromId', source, function(user)
			if user ~= nil then
				cash = user.getMoney()
			end
		end)
		return cash or 0
    end)

    exports["kgv-blackjack"]:SetTakeChipsCallback(function(source, amount)
        TriggerEvent('es:getPlayerFromId', source, function(user)
			if user ~= nil then
				user.removeMoney(amount)
			end
		end)
    end)

    exports["kgv-blackjack"]:SetGiveChipsCallback(function(source, amount)
        TriggerEvent('es:getPlayerFromId', source, function(user)
			if user ~= nil then
				user.addMoney(amount)
			end
		end)
    end)
end

AddEventHandler("onResourceStart", function(resourceName)
	if ("kgv-blackjack" == resourceName) then
        Citizen.Wait(1000)
        SetExports()
    end
end)

SetExports()
1 Like

This is not working with esx. when i try to play it says this
homo

did you download the esx module?

i am having a lot of fun with this. now all there is needed is poker.

heyo, is it possible to get it working with this money resource?

atm when i sit down at the tables it tells me i dont have enough money to place a bet :frowning:

am pretty sucky at coding so if anyone can tell me how to get it working i would appreciate it :upside_down_face:

It is. You just need to setup the callbacks (in a server script) in your money resource.

exports["kgv-blackjack"]:SetGetChipsCallback(function(source)
		return 0 -- [[ return money ]]
	end)

	exports["kgv-blackjack"]:SetTakeChipsCallback(function(source, amount)
		--[[ money = money - amount? ]]
	end)

	exports["kgv-blackjack"]:SetGiveChipsCallback(function(source, amount)
		--[[ money = money + amount? ]]
	end)

Inside SetGetChipsCallback function, you have to get the players money (cash or bank, depending on what you want to play with.) and return them in return

The other 2, are self-explanatory. Those functions get called whenever a player needs to lose / gain money, and the amount.

Now, the resource that you showed is kinda bad, because it doesn’t seem to save a player’s cash anywhere on the server, so you will have to do a bit of coding to modify that.