Jump to content
  • 0

help Black Jack


PewN

Question


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  


L_Play:
mes "[Dealer]";
mes "Please place your bets...";
next;
menu "10Tickets",M_1a, "50Tickets",M_1b, "100Tickets",M_1c, "500Tickets",M_1d, "Too rich for my blood....",M_End;

M_1a:
if(countitem(19252)<10) goto sL_NotEnuf;
[color=#ff0000]set @bet, 10;[/color]
goto L_Cont0;
M_1b:
if(countitem(19252)<50) goto sL_NotEnuf;
[color=#ff0000]set @bet, 50;[/color]
goto L_Cont0;
M_1c:
if(countitem(19252)<100) goto sL_NotEnuf;
[color=#ff0000]set @bet, 100;[/color]
goto L_Cont0;
M_1d:
if(countitem(19252)<500) goto sL_NotEnuf;
[color=#ff0000]set @bet, 500;[/color]
goto L_Cont0;

sL_NotEnuf:
mes "[Dealer]";
mes "I'm sorry but you don't have enough zeny to make that bet.";
close;

L_Cont0:
mes "(the cards are being dealt)";
next;
deletearray $@card[0],13;
set @dealerTurn, 0;
set @numP, 0;
set @numD, 0;
set @pAce, 0;
set @dAce, 0;
callsub sF_GetCards, @numP, @playCard[@numP], @playCard$[@numP], @pAce;
callsub sF_GetCards, @numP, @playCard[@numP], @playCard$[@numP], @pAce;
callsub sF_GetCards, @numD, @dealCard[@numD], @dealCard$[@numD], @dAce;
callsub sF_GetCards, @numD, @dealCard[@numD], @dealCard$[@numD], @dAce;

//==============
L_Start:
callsub sF_GetTot;

mes "- Here are the ^FF5533DEALER'S^000000 cards:";
if (@numD==2) callsub sF_D2cards;
if (@numD==3) callsub sF_D3cards;
if (@numD==4) callsub sF_D4cards;
if (@numD==5) callsub sF_D5cards;
mes "	The DEALER has: ^FF5533"+@dealTot+"^000000";
mes " ";
mes "- Here are ^5533FFYOUR^000000 cards:";
if (@numP==2) callsub sF_P2cards;
if (@numP==3) callsub sF_P3cards;
if (@numP==4) callsub sF_P4cards;
if (@numP==5) callsub sF_P5cards;
if(@pAce != 1 || @playTot == 21) mes "	YOU have: ^5533FF" +@playTot+ "^000000";
if(@pAce == 1 && @playTot != 21) mes "	You have: ^5533FF" +@playTot+ "^000000, or ^5533FF" +(@playTot-10)+ "^000000";
next;
if(@playTot==21 && @dealTot==21) goto sL_Push;
if(@numP==2 && @playTot == 21) goto sL_Win;
if(@numD==2 && @dealTot == 21) goto sL_Lose;
if(@playTot > 21) goto sL_Lose;
if(@dealTot > 21) goto sL_Win;
if(@numP==2 && @dealerTurn==0) menu "Hit me(pull)",M_Hit, "Stay",M_Stay, "Double Down",M_Double;
if(@dealerTurn == 0) menu "Hit me(pull)",M_Hit, "Stay",M_Stay;

M_Stay:
mes "[Dealer]";
if(@playTot < 13) goto sL_PlayToLow;
if(@dealTot > 16) mes "The Dealer stays.";
if(@dealTot > 16 || @numD == 5) goto L_Check;
mes "The Dealer is going to pull";
next;
callsub sF_GetCards, @numD, @dealCard[@numD], @dealCard$[@numD], @dAce;
set @dealerTurn, 1;
goto L_Start;

sL_PlayToLow:
mes "I'm sorry but you do not have a high enough total to stay.  You must pull.";
next;
goto M_Hit;

M_Hit:
if(@numP == 5) goto M_Stay;
callsub sF_GetCards, @numP, @playCard[@numP], @playCard$[@numP], @pAce;
goto L_Start;
M_Double:
mes "[Dealer]";
mes "Player has chosen to Double Down.  You're current bet will be";
mes "doubled, and you will only be able to pull 1 extra card.";
next;
set @dealerTurn, 1;
set @bet, @bet*2;
callsub sF_GetCards, @numP, @playCard[@numP], @playCard$[@numP], @pAce;
goto L_Start;

//=============
L_Check:
next;
if(@playTot < @dealTot) goto sL_Lose;
if(@playTot == @dealTot) goto sL_Push;

sL_Win:
mes "[Dealer]";
mes "Congratulations, you've won!";
next;
[color=#ff0000]getitem 7227, + @bet;[/color]
goto L_Play;
sL_Lose:
mes "[Dealer]";
mes "I'm sorry but you've lost.";
[color=#ff0000]delitem 7227, - @bet;[/color]
next;
goto L_Play;
sL_Push:
mes "[Dealer]";
mes "Its a push.  You tied with the Dealer.";
next;
goto L_Play;

please help me i think those in color red are my error :(

im win but. the items i bet doesn't multiply and deleting

Edited by Arcenciel
Codeboxed
Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  137
  • Reputation:   23
  • Joined:  06/08/12
  • Last Seen:  

0-@bet

0+@bet

try this

Edited by GM Zimtkeks
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

0-@bet

0+@bet

try this

the npc doesn't deleting items when im lose. even when im win. i can't get items.

bump!. anyone?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   0
  • Joined:  05/18/12
  • Last Seen:  

Change

getitem 7227, + @bet;
delitem 7227, - @bet;

to

getitem 7227,@bet;
delitem 7227,@bet;

Edited by Rime
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  137
  • Reputation:   23
  • Joined:  06/08/12
  • Last Seen:  

He wants to give TCG out for the winner though

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

BTW. SOLVED!.

ill just add

set .custom_item,7227;

and change this to

getitem .custom_item,@bet;

detitem .custom_item,@bet;

it's same Rime!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  69
  • Reputation:   10
  • Joined:  05/14/12
  • Last Seen:  

He wants to give TCG out for the winner though

When using the getitem command, + and - don't work. @bet, if it's 5, meaning the player bet 5, will get 5 of them, or delete 5 of them. It's not based on + or -, but rather the command itself. delitem is the opposide of getitem, so it will instead of giving 5 tickets, it will delete 5 of them.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...