[FilterScript] [FS]Multiplayer Black Jack mini-game by Joe Staff
#1

About
It's a simple multiplayer blackjack game like that played at the casinos, only difference is: instead of playing against the house (NPC) you play against other players. It's got a simple GUI with textdraws and buttons you press to start,hit, and stay.

How To Play
Well first a player need to host a game. That player types "/StartBlackJack <Bet Amount>" then a window will pop-up explaining that it's waiting for more players and the amount you are betting for is taken away from you.

After that the host will type "/Invite <playerid>" and that player will receive the invite to play.

That invited player will type "/AcceptInvite" and he will lose the money that is the bet amount. You can invite up to 3 more players for a 4 way game.

If 2 or more players are there, the host can start the game by pressing the "Fire" button (default: Left Mouse Button) and each player will receive 2 cards, one being shown to all players.

Then players take turns hitting or staying, if you hit then it's the next players turn and you'll get your chance to hit or stay again once all players have had their turn. If you stay then you wait until the game is over to show your cards.

The objective of "Black Jack" is to get to 21 without going over, if you go over you bust and are out for the game. The player with the closest to 21 wins, if more than one player has the highest amount (a tie) then those players bust, and the money is split between them. A 5 Card Jimmy rule is enabled meaning if you have 5 cards without going over 21, it's the same as having 21.

When the game is over the players can walk again and can type "/CloseGame" to close the window.

Refer to BlackJack on Wikipedia for help on the original Black Jack game. Thanks to Don Correlli for the link.

Commands
"/StartBlackJack <Bet Amount>" -- Starts a game with the corresponding amount, $0 is applicable
"/Invite <playerid>" -- Invites the player to the game
"/CancelInvite" -- Cancels the invite so you can invite a different player
"/AcceptInvite" -- Accepts the invite if one has been given to you
"/DeclineInvite" -- Declines the invite
"/CloseGame" -- Can be typed at anytime during game, but you will lose your bet amount, and the game is canceled. Money is split between the remaining players

Special Thanks
Special thanks to the testers that helped me, since it's difficult to test a multiplayer game with only one person.
Mike Morrison
KevKo
Shadow
Ben Lewis
DeathGod
anyone else I didn't mention was probably not worth mentioning anyway

Resources
This is pretty important, because each player has their own 5 textdraws, a server with 200 players playing simultaneously will only have room for 24 other textdraws. This is ONLY if exactly 200 players are playing at the exact same time.

TextDraws Used: 5xMAX_PLAYERS=1001* maximum

*plus one more acting as a bug remover, when a server GMXes it for some reason deletes the first textdraw, so a null textdraw is created and useless placed away

Download
Due to host changing and backups not being made, I was only able to salvage the .PWN thanks to Shadow
BlackJack Game.PWN
BlackJack Game.AMX
Mirror
Mirror by Klutty -> in "File Catalog"

Bugs
If you find any bugs please tell me how you got it so I can re-enact it and then fix it. Me and my friends have spent a lot of time searching for bugs but nothing beats the tedious critique of hundreds of players.

Picture
[Image: BJ3.JPG]
Reply
#2

Whtf ? what is it ?
Reply
#3

Not sure how I could describe it any further, sorry man. Try playing in the casinos in venturas some time.
Reply
#4

It's basically a card game & nice work.
Reply
#5

It looks great, nice!
Reply
#6

Good Job Joe.
Reply
#7

Nice work Joe
Reply
#8

Nice.
Reply
#9

This looks good, I'm just intrigued as to what this achieves:

pawn Код:
((card/4)*4)
Reply
#10

ey Well done joe, all the kinks worked out now ? D
Reply
#11

Quote:
Originally Posted by Weirdosport
This looks good, I'm just intrigued as to what this achieves:

pawn Код:
((card/4)*4)
It's a way of determining the suit of the card, if you card is #13 of 52. 13/4 = 3 by pawn standards, 3*4 = 12, 13-12 = 1, so 12,13,14, and 15 would be the suits of card 3. 0 = Hearts, 1 = Clubs, 2 = Diamonds, 3 = Spades. In this case, 13 is the 3 of Clubs
Reply
#12

Need a mirror for ya files?
Reply
#13

This looks cool. It would be cool if you had done something with cards just for the player's hand. Like maybe a big textdraw box with the number in top and bottom corners and the symbol in the middle. Idk just suggesting. :P
Reply
#14

Quote:
Originally Posted by Klutty
Need a mirror for ya files?
Thanks for the offer, but my host has infinite bandwidth. If you want to host it anyway, I'll set it up there as a back-up (cause my host is infamous for being slow for 5 minute intervals)

Quote:
Originally Posted by backwardsman97
This looks cool. It would be cool if you had done something with cards just for the player's hand. Like maybe a big textdraw box with the number in top and bottom corners and the symbol in the middle. Idk just suggesting. :P
That would be cool, but as you can see, it's taking up a huge amount of space as it is.
Reply
#15

Quote:
Originally Posted by SilentHuntR
Quote:
Originally Posted by Klutty
Need a mirror for ya files?
Thanks for the offer, but my host has infinite bandwidth. If you want to host it anyway, I'll set it up there as a back-up (cause my host is infamous for being slow for 5 minute intervals)
Aight, here you go, use it for backup or w/e you want.

http://klutty.co.cc/load/2-1-0-2
Reply
#16

wow nice work Oh wait i don't know how to play Black Jack xDD
Reply
#17

Quote:
Originally Posted by @TheShadow@
wow nice work Oh wait i don't know how to play Black Jack xDD
http://en.wikipedia.org/wiki/Black_Jack :P
Reply
#18


Nice , gonna try this out :P (1000th post weh)
Reply
#19

http://pastebin.com/m129b3ef1 Pastebin link
Reply
#20

Pastebin Pastebin << Better Link
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)