Technoken Posted August 10, 2017 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 505 Reputation: 127 Joined: 04/04/16 Last Seen: April 13 Share Posted August 10, 2017 View File Dicebet Gambling Dicebet Gambling This is a simple script that allows players to gamble with other player using dicebet command. This idea came from GTA SAMP which me and my brother played before. He asked me if I can implement it into his server so I did. I decided to share it here so I can give some contribution here even with this simple script. I hope you guys would like it and please report if you found any bugs in the script. I'm actually thinking ways to optimize this script and add some features into it. So I guess suggestions will be welcome. Configuration OnInit: .MinBet = 1; // Minimum amount to bet .MaxBet = 500000000; // Maximum amount to bet NOTE: If you increase it by 500m, make sure that max zeny allowed per char is > 1b New Atcommands@dicebet <opponent name> <amount to bet> - sends a dicebet invitation to another player@acceptdb - accepts the dicebet invitation@declinedb - declines the dicebet invitation@resetdb - resets the dicebet invitation Submitter Technoken Submitted 08/06/2017 Category Games, Events, Quests Video Content Author Technoken 2 Quote Link to comment Share on other sites More sharing options...
Radian Posted August 10, 2017 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 1546 Reputation: 192 Joined: 07/23/14 Last Seen: June 24, 2024 Share Posted August 10, 2017 Prevent scammers when playing dice.. nice one! Quote Link to comment Share on other sites More sharing options...
skymia Posted August 17, 2017 Group: Members Topic Count: 63 Topics Per Day: 0.02 Content Count: 298 Reputation: 4 Joined: 02/19/17 Last Seen: May 26, 2024 Share Posted August 17, 2017 Ihave this type of error...need assistance sir Quote Link to comment Share on other sites More sharing options...
Technoken Posted August 17, 2017 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 505 Reputation: 127 Joined: 04/04/16 Last Seen: April 13 Author Share Posted August 17, 2017 @skymia You need to update your trunk files or apply this patch manually. LINK Quote Link to comment Share on other sites More sharing options...
rmon Posted November 18, 2017 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 97 Reputation: 2 Joined: 04/27/16 Last Seen: 6 hours ago Share Posted November 18, 2017 Hi, Using the latest rathena, Getting an error below Quote Link to comment Share on other sites More sharing options...
Technoken Posted November 19, 2017 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 505 Reputation: 127 Joined: 04/04/16 Last Seen: April 13 Author Share Posted November 19, 2017 14 hours ago, rmon said: Hi, Using the latest rathena, Getting an error below Updated to 1.1. Please re-download the file. Thanks for reporting. Quote Link to comment Share on other sites More sharing options...
blazerza Posted February 27, 2018 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 42 Reputation: 2 Joined: 02/04/12 Last Seen: June 1, 2021 Share Posted February 27, 2018 On 19/11/2560 at 6:16 PM, Technoken said: Updated to 1.1. Please re-download the file. Thanks for reporting. What if I want to change it from zeny to item how can I do it sir ?example : if I want to bet with my cash coin/card/etc. Quote Link to comment Share on other sites More sharing options...
Technoken Posted February 27, 2018 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 505 Reputation: 127 Joined: 04/04/16 Last Seen: April 13 Author Share Posted February 27, 2018 8 hours ago, blazerza said: What if I want to change it from zeny to item how can I do it sir ?example : if I want to bet with my cash coin/card/etc. That would be a new feature. I'll try to update it with that feature when I get my free time. Quote Link to comment Share on other sites More sharing options...
blazerza Posted February 28, 2018 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 42 Reputation: 2 Joined: 02/04/12 Last Seen: June 1, 2021 Share Posted February 28, 2018 @Technoken Thank you sir I will try to make it too and I will share here if it works Quote Link to comment Share on other sites More sharing options...
rmon Posted July 21, 2020 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 97 Reputation: 2 Joined: 04/27/16 Last Seen: 6 hours ago Share Posted July 21, 2020 I tried to using this on 2018 Client, using latest rathena. The char who initiate dicebet is not rolling a dice once the other char use @acceptdb showing /dice emoticon Quote Link to comment Share on other sites More sharing options...
Gidz Cross Posted November 17, 2020 Group: Members Topic Count: 133 Topics Per Day: 0.03 Content Count: 686 Reputation: 89 Joined: 04/07/14 Last Seen: 4 hours ago Share Posted November 17, 2020 On 7/22/2020 at 5:00 AM, rmon said: I tried to using this on 2018 Client, using latest rathena. The char who initiate dicebet is not rolling a dice once the other char use @acceptdb showing /dice emoticon yep. Please update thanks! Quote Link to comment Share on other sites More sharing options...
clashlucifer Posted August 30, 2021 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 11 Reputation: 1 Joined: 02/01/14 Last Seen: June 27, 2024 Share Posted August 30, 2021 On 11/17/2020 at 8:46 PM, Gidz Cross said: yep. Please update thanks! yep. Please update thanks very much! Quote Link to comment Share on other sites More sharing options...
LearningRO Posted December 6, 2022 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 15 hours ago Share Posted December 6, 2022 Fix both char right now show their dice //===== rAthena Script ======================================= //= Dicebet Gambling //===== By: ================================================== //= Technoken //= LearningRO //===== Current Version: ===================================== //= 1.2 //===== Features: ============================================ //= Gamble with other players using dicebet. //= This idea came from GTA Samp gamble system //= New atcommands: //= @dicebet <opponent name> <amount to bet> //= - sends a dicebet invitation to another player //= @acceptdb - accepts the dicebet invitation //= @declinedb - declines the dicebet invitation //= @resetdb - resets the dicebet invitation //===== Features: ============================================ // //= THIS IS A FREE SCRIPT // //===== Change Logs: ========================================= //= 1.0 First version. //= 1.1 Updated script to work on rAthena Hash ea88ea5 //= 1.2 Both Char right now show their own DICE! //============================================================ - script DicebetGambling -1,{ OnInit: .MinBet = 1; // Minimum amount to bet .MaxBet = 500000000; // Maximum amount to bet NOTE: If you increase it by 500m, make sure that max zeny allowed per char is > 1b bindatcmd("dicebet","DicebetGambling::OnAtcommandDicebet",0,99); bindatcmd("acceptdb","DicebetGambling::OnAtcommandAcceptDB",0,99); bindatcmd("declinedb","DicebetGambling::OnAtcommandDeclineDB",0,99); bindatcmd("resetdb","DicebetGambling::OnAtcommandResetDB",0,99); end; OnAtcommandDicebet: if( .@atcmd_numparameters < 2 ) { message strcharinfo(0),"Silakan memasukan format yang benar (format: @dicebet <nama player> <jumlah taruhan>)"; message strcharinfo(0),"@dicebet gagal."; end; } .@tmp$ = implode(.@atcmd_parameters$," "); .@eil = getstrlen(.@atcmd_parameters$[.@atcmd_numparameters-1]) + 1; .@charName$ = substr(.@tmp$, 0, (getstrlen(.@tmp$) - .@eil) - 1); @oppRID = getcharid(3,.@charName$); @oppCID = getcharid(0,.@charName$); setd "$var$",strcharinfo(0); if( !isloggedin(@oppRID,@oppCID) ) { message strcharinfo(0),"Nama Karakter tidak ditemukan."; message strcharinfo(0),"Karakter sedang offline atau tidak ada."; message strcharinfo(0),"@dicebet gagal."; end; } if( @oppRID == getcharid(3) ) { message strcharinfo(0),"Kamu tidak dapat mengajak dirimu bertaruh."; message strcharinfo(0),"@dicebet gagal."; end; } if( @onbet || @diceDealerCID ) { // Prevents from offering another one message strcharinfo(0),"1x taruhan dalam sekali."; message strcharinfo(0),"@dicebet gagal."; end; } getmapxy(.@map$,.@x,.@y,BL_PC); getmapxy(.@map1$,.@x1,.@y1,BL_PC,rid2name(@oppRID)); if( distance( .@x, .@y, .@x1, .@y1 ) > 3 ) { // 3 cells distance message strcharinfo(0),"You must be near to your opponent."; message strcharinfo(0),"@dicebet failed."; end; } .@oppInviter = getvar(@onbet,@oppCID); // Opponent already invite someone .@oppInvited = getvar(@diceDealerCID,@oppCID); // Opponent is already invited by someone if( .@oppInviter || .@oppInvited ) { // Prevents from dealing inviters and someone whos already on a bet message strcharinfo(0),.@charName$+" sedang bertaruh dengan yang lain."; message strcharinfo(0),"@dicebet failed."; end; } .@bet = .@atcmd_parameters$[.@atcmd_numparameters-1]; if( .@bet > .MaxBet || .@bet < .MinBet ) { message strcharinfo(0),"Minimum Taruhan: "+.MinBet+"z"; message strcharinfo(0),"Maximum Taruhan: "+.MaxBet+"z"; message strcharinfo(0),"@dicebet gagal."; end; } // Checks if the opponent has right amount of zeny to bet .@oppZeny = readparam(Zeny,@oppCID); if( .@oppZeny < .@bet ) { message strcharinfo(0),"Lawanmu tidak memiliki cukup zeny."; message strcharinfo(0),"@dicebet gagal."; end; } if( Zeny < .@bet ) { message strcharinfo(0),"Kamu tidak memiliki cukup zeny untuk bertaruh."; message strcharinfo(0),"@dicebet gagal."; end; } set(@dicebet,.@bet,@oppCID); // Sets the bet set(@diceDealerCID,getcharid(0),@oppCID); // Sets who's the dealer set(@diceDealerRID,getcharid(3),@oppCID); @onbet = 1; // Sets to 1 when the player already dicebet someone dispbottom "Kamu telah mengajak "+rid2name(@oppRID)+" taruhan sebesar "+.@bet+"z.",0x63D1F4; dispbottom strcharinfo(0)+" telah menawarkan taruhan sebesar "+.@bet+"z. Apakah kamu ingin menerima ? (Gunakan @acceptdb/@declinedb)",0x63D1F4,@oppCID; end; OnAtcommandAcceptDB: if( @rolling ) { message strcharinfo(0),"Kamu sedang memutar dice"; message strcharinfo(0),"@acceptdb gagal."; end; } if( !@diceDealerCID ) { message strcharinfo(0),"Tidak ada yang mengajak kamu bertaruh."; message strcharinfo(0),"@acceptdb gagal."; end; } if( .@atcmd_numparameters != 0 ) { message strcharinfo(0),"Silakan memasukan format yang benar (format: @acceptdb)"; message strcharinfo(0),"@acceptdb gagal."; end; } if( !isloggedin(@diceDealerRID,@diceDealerCID) ) { message strcharinfo(0),"Lawanmu telah offline."; message strcharinfo(0),"@acceptdb gagal."; goto D_Reset; end; } if( Zeny < @dicebet ) { message strcharinfo(0),"Kamu tidak memiliki cukup zeny untuk menerima taruhan."; message strcharinfo(0),"@acceptdb gagal."; end; } .@oppZeny = readparam(Zeny,@diceDealerCID); // Checks if the opponent still has the zeny that he bet if( .@oppZeny < @dicebet ) { message strcharinfo(0),"Lawanmu tidak memiliki cukup zeny untuk bertaruh."; message strcharinfo(0),"@dicebet gagal."; end; } getmapxy(.@map$,.@x,.@y,BL_PC); getmapxy(.@map1$,.@x1,.@y1,BL_PC,rid2name(@diceDealerRID)); if( distance( .@x, .@y, .@x1, .@y1 ) > 3 ) { message strcharinfo(0),"Kamu harus dekat dengan lawan."; message strcharinfo(0),"@acceptdb gagal."; end; } getmapxy(.@map$,.@x,.@y,BL_PC); .@bet = @dicebet; .@ownRID = getattachedrid(); .@diceDealerRID = @diceDealerRID; @rolling = 1; dispbottom strcharinfo(0)+" menerima taruhan sebesar "+@dicebet+"z.",0x63D1F4,@diceDealerCID; setarray .@dice[1],ET_DICE1,ET_DICE2,ET_DICE3,ET_DICE4,ET_DICE5,ET_DICE6; .@rand = rand(1,6); emotion .@dice[.@rand],strcharinfo(0); detachrid; attachrid(.@diceDealerRID); .@rand1 = rand(1,6); emotion .@dice[.@rand1],.@diceDealerRID; detachrid; attachrid(.@ownRID); sleep2 1200; if( !isloggedin(@diceDealerRID) || !@diceDealerCID ) { // Checks if the inviter logged out dispbottom strcharinfo(0,@diceDealerCID)+" logout dan batalkan taruhan.",0x63D1F4; goto D_Reset; end; } //.@diceDealerRID = @diceDealerRID; while( .@i < 2 ) { // Checks Zeny again if( Zeny < .@bet ) { areaannounce .@map$,.@x-3,.@y-3,.@x+3,.@y+3,"Taruhan telah dibatalkan karena zeny "+strcharinfo(0)+" telah habis !",0,0x63D1F4; .@t++; } detachrid; if( .@i == 0 ) attachrid(.@diceDealerRID); else attachrid(.@ownRID); .@i++; } if( !.@t ) { areaannounce .@map$,.@x-3,.@y-3,.@x+3,.@y+3,"* * "+strcharinfo(0,@diceDealerCID)+" memutar dice dan mendapatkan angka "+.@rand1+" * *",0,0x63D1F4; areaannounce .@map$,.@x-3,.@y-3,.@x+3,.@y+3,"* * "+strcharinfo(0)+" memutar dice dan mendapatkan angka "+.@rand+" * *",0,0x63D1F4; if( .@rand == .@rand1 ) // Both dice lands on same number areaannounce .@map$,.@x-3,.@y-3,.@x+3,.@y+3,"Tidak ada yg memenangkan "+.@bet+"z karena draw.",0,0x63D1F4; else { if( .@rand > .@rand1 ) { // I WON Zeny += .@bet; .@winner$ = strcharinfo(0); detachrid; attachrid(.@diceDealerRID); Zeny -= .@bet; } else { // I LOSE Zeny -= .@bet; detachrid; attachrid(.@diceDealerRID); .@winner$ = strcharinfo(0); Zeny += .@bet; } detachrid; attachrid(.@ownRID); areaannounce .@map$,.@x-3,.@y-3,.@x+3,.@y+3,.@winner$+" telah memenangkan taruhan sebesar "+.@bet+"z.",0,0x63D1F4; } } set(@onbet,0,@diceDealerCID); goto D_Reset; end; OnAtcommandDeclineDB: if( @rolling ) { message strcharinfo(0),"Kamu sedang memutar dice."; message strcharinfo(0),"@declinedb gagal."; end; } if( .@atcmd_numparameters != 0 ) { message strcharinfo(0),"Silakan memasukan format yang benar (format: @declinedb)"; message strcharinfo(0),"@declinedb gagal."; end; } if( !@diceDealerCID ) { message strcharinfo(0),"Tidak ada yang mengajak kamu bertaruh."; message strcharinfo(0),"@declinedb gagal."; end; } dispbottom "Taruhan telah ditolak.",0x63D1F4; dispbottom strcharinfo(0)+" menolak untuk bertaruh.",0x63D1F4,@diceDealerCID; set(@onbet,0,@diceDealerCID); goto D_Reset; end; OnAtcommandResetDB: if( @oppCID ) .@rolling = getvar(@rolling,@oppCID); else .@rolling = 0; if( .@rolling ) { message strcharinfo(0),"Kamu sedang memutar dice."; message strcharinfo(0),"@resetdb gagal."; end; } if( !@onbet ) { message strcharinfo(0),"Kamu tidak memiliki undangan yang tertunda."; message strcharinfo(0),"@resetdb gagal."; end; } @onbet = 0; dispbottom "Undangan yang tertunda telah direset."; detachrid; attachrid(@oppRID); dispbottom "Pending dicebet invitation has been cancelled."; goto D_Reset; end; OnPCLogoutEvent: if( @onbet ) { detachrid; attachrid(@oppRID); goto D_Reset; } if( @diceDealerCID ) { // When the one who use @acceptdb logged out dispbottom strcharinfo(0)+" logged out and cancels the dice bet.",0x63D1F4,@diceDealerCID; set(@onbet,0,@diceDealerCID); } end; D_Reset: @dicebet = 0; @diceDealerCID = 0; @diceDealerRID = 0; @rolling = 0; end; } 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.