[Release] BlackJack

What this is:

  • BlackJack using HTML, CSS, and JS

What this isn’t:

  • Fully complete. It doesn’t give you any money, or take any away. If you want to add this to your RP servers then you must code in the functions that do so inside Win() and Lost()
  • It’s only single player, you vs the dealer.

Description:
BlackJack uses pakastin’s ‘deck-of-cards’ to create a black jack table!
I have tested this a bit, everything seems to be working. Let me know if there is any bugs I will try to fix them when I can!

Keys:

  • G = Find the black B on the map (At the casino) walk up and
  • Escape = Press twice to exit BlackJack

How-To:

  1. Goto the marker, press G
  2. Play BlackJack. You will not gain or loose money unless you have codded in what ever function is needed to remove and gain money. There is a Win() and Lose() function where you can do so.

Downloads:
BlackJack: https://github.com/LexTheGreat/blackjack/archive/master.zip

Images:


10 Likes

This is just what i needed. 10/10

1 Like

Great script :slight_smile:

Will use it, thx for share

Awesome! Just abit help to add so players can bet/lose money would be awesome !

Awesome script! Can someone send me a code where:
if you lose money is going to MAFIA BOSS ACCOUNT?

I don’t use a framework, I believe there is more than one so I didn’t pick one and leave the other one out. It shouldn’t be that hard to put something inside Win() and Lost() they are called when you win and lose.

Something like

this.Win = function() {
		// Do Something With .bet
                SomeObject.giveMoney(self.bet);
                self.bet = 0;
		self.myTurn = true;
	}
	
	this.Lost = function() {
		// Do Something With .bet
                SomeObject.giveMoney(-self.bet);
                self.bet = 0;
		self.myTurn = true;
	}

@Lex_The_Great how do you exit it once your in it?

Press escape twice and it will exit. That part is a work in progress…

document.onkeyup = function (data) {
  if (data.which == 27) {
     $.post('http://blackjack/escape', JSON.stringify({}));
  }
};
1 Like

I was having problems getting locked out of the game at some points. canEscape should be false when you are playing a round so that you can’t rage quit (And not loose money). I didn’t finish it tho, I keep getting locked out when testing so I made it twice to get past it for now.

Amazing ! Thank you very much :slight_smile:

How can i add coordonnes plz ? i can see this :
this.Markers = [[930.031, -953.270, 44.38]]; // [0,1,2]
this.Locations = [[930.031, -953.270, 44.38]];// [0,1,2]

But i dont know how add more, can you help me plz ?
thank you

Locations adds the circle on the ground. Markers adds the blip on the map! So you should have one marker at your casino, then multiple locations!

Do I have your permission to upload a ESX modified version of this?

Will credit you of course.

1 Like

Sure go ahead! Open-source all the way. This was just an example anyway! My code wasn’t very clean in this either :s

Did someone already edit this with money system ?
If yes can you share this with me please?

so i put it in and went to use it and it just puts my cursor on my screen and still says press g to play black jack in the corner, any ideas?

Anyone managed to add function to win and lose money? I need it badly