Overview
I've been coding some quick addons for my server, and I'll also resolve issues that come to my attention. But this is a simple feature I coded, didn't take me much longer than 10 minutes, but I'm sure hotels will find it useful in some way, so here it is.
Feature
A new BubbleJuice Arena system coded so two users can fight it out in a small arena created by the hotel owner. The coordinates are already set for the rooms of Phoenix Emulator's database, so no coordinates or roomID's need to be changed. Your user must type :arena, and it will put them ingame. If a user is dead, they will not be sent to hospital, and just poof out of game, and the winner will win 20 credits, but each must pay 10 credits to play.
Improvements are needed!
Never really tested it much, but for the most part looked like it worked. But test for yourself, and work on any glitches needed. But below are the codes needed.
Next you need to add this into the punch command, so if a user dies from the game, they aren't sent to the hospital.Code:#region :arena case "arena": { string credits; credits = DB.runRead("SELECT credits FROM users WHERE id = '" + userID + "'"); string amount; amount = "0"; int credits_int = int.Parse(credits); int amount_int = int.Parse(amount); if (credits_int <= amount_int) { Room.sendWhisper(roomUser, _Username, "Not enough money to perform this action."); } else { virtualUser Target = userManager.getUser(args[1]); if (_Mission == "[BBJ] Red Team") { } else if (_Mission == "[BBJ] Blue Team") { } else if (_roomID == 353 && roomUser.Y == 10 && roomUser.X == 4) { Room.sendWhisper(roomUser, _Username, "BubbleJuice Arena: Fight!"); _Mission = "[BBJ] Red Team"; _Figure = _hr + _hd + _sh + "lg-696-100"; DB.runQuery("UPDATE users SET credits = credits + '-10' WHERE name = '" + _Username + "'"); refreshAppearance(false, true, true); } } if (credits_int <= amount_int) { Room.sendWhisper(roomUser, _Username, "Not enough money to perform this action."); } else { if (_Mission == "[BBJ] Blue Team") { } else if (_Mission == "[BBJ] Red Team") { } else if (_roomID == 353 && roomUser.Y == 10 && roomUser.X == 11) { Room.sendWhisper(roomUser, _Username, "BubbleJuice Arena: Begin!"); _Mission = "[BBJ] Blue Team"; _Figure = _hr + _hd + _sh + "lg-696-107"; refreshAppearance(false, true, true); DB.runQuery("UPDATE users SET credits = credits + '-10' WHERE name = '" + _Username + "'"); } } } break; #endregion
Code:if (User._Mission == "[BBJ] Red Team") { DB.runQuery("UPDATE users SET game_arena = game_arena + '1' WHERE name = '" + _Username + "'"); DB.runQuery("UPDATE users SET credits +20 = credits + '20' WHERE name '" + _Username + "'"); Room.sendShout(roomUser, "*Swings at " + args[1] + ", knocking them out and winning the fight*", true); }Also in the database, you need to add a column in the users table. Which is game_arena with a int of 2 and defined as 0.Code:if (User._Mission == "[BBJ] Blue Team") { DB.runQuery("UPDATE users SET game_arena = game_arena + '1' WHERE name = '" + _Username + "'"); DB.runQuery("UPDATE users SET credits +20 = credits + '20' WHERE name '" + _Username + "'"); Room.sendShout(roomUser, "*Swings at " + args[1] + ", knocking them out and winning the fight*", true); }
Credits to me for this, enjoy!



![[Holograph] Phoenix Emulator BBJ Arena [Addon]](http://ragezone.com/hyper728.png)


