Solved (URGENT)Need help with Timer

Discussion in 'Plugin Development' started by mrgreen33gamer, May 17, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    mrgreen33gamer

    Hello! I am having a lot of problems! Whenever I type the command to make the game start, it kicks me from my server and says Internal Error.

    The code below explains it all:

    Code:java
    1.  
    2.  
    3. package com.mrgreen33gamer;
    4.  
    5. import java.util.ArrayList;
    6. import java.util.HashMap;
    7.  
    8. import org.bukkit.Bukkit;
    9. import org.bukkit.ChatColor;
    10. import org.bukkit.Location;
    11. import org.bukkit.Material;
    12. import org.bukkit.command.Command;
    13. import org.bukkit.command.CommandSender;
    14. import org.bukkit.entity.Player;
    15. import org.bukkit.event.EventHandler;
    16. import org.bukkit.event.Listener;
    17. import org.bukkit.event.entity.EntityDamageByEntityEvent;
    18. import org.bukkit.event.entity.PlayerDeathEvent;
    19. import org.bukkit.event.player.PlayerQuitEvent;
    20. import org.bukkit.inventory.ItemStack;
    21. import org.bukkit.plugin.java.JavaPlugin;
    22. import org.bukkit.scheduler.BukkitRunnable;
    23.  
    24. import com.mrgreen33gamer.econ.EconManager;
    25. import com.mrgreen33gamer.kits.OtherCommands;
    26.  
    27. public class Main extends JavaPlugin implements Listener{
    28. private static Main plugin;
    29.  
    30. public static ArrayList<String> qplayers = new ArrayList<String>();
    31. public static ArrayList<String> playersleft = new ArrayList<String>();
    32. public static ArrayList<Boolean> isplaying = new ArrayList<Boolean>();
    33. public static ArrayList<Boolean> setstopped = new ArrayList<Boolean>();
    34. public static HashMap<String, Boolean> canhit = new HashMap<String, Boolean>();
    35.  
    36. @Override
    37. public void onEnable(){
    38. getServer().getPluginManager().registerEvents(this, this);
    39. }
    40. @Override
    41. public void onDisable(){
    42.  
    43. }
    44.  
    45.  
    46. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
    47. Player player = (Player)sender;
    48.  
    49. if(commandLabel.equalsIgnoreCase("sg")){
    50. if(args.length == 0){
    51. player.sendMessage(ChatColor.RED + "=========" + ChatColor.YELLOW + " SurvivalGames " + ChatColor.RED + "=========");
    52. player.sendMessage(ChatColor.AQUA + "/sg join " + ChatColor.GREEN + "-" + ChatColor.RED + " joins an SG game.");
    53. player.sendMessage(ChatColor.AQUA + "/sg leave " + ChatColor.GREEN + "-" + ChatColor.RED + " joins an SG game.");
    54. player.sendMessage(ChatColor.AQUA + "/sg players " + ChatColor.GREEN + "-" + ChatColor.RED + " checks total players in SG game");
    55. }else if(args[0].equalsIgnoreCase("join")){
    56. if(isplaying.contains(true)){
    57. player.sendMessage(ChatColor.GREEN + "SG" + ChatColor.GRAY + "> " + ChatColor.RED + "The game has already started");
    58. }else{
    59. if(qplayers.contains(player.getName())){
    60. player.sendMessage(ChatColor.GREEN + "SG" + ChatColor.GRAY + "> " + ChatColor.RED + "You have already joined.");
    61. }else{
    62. qplayers.add(player.getName());
    63. player.sendMessage(ChatColor.GREEN + "SG" + ChatColor.GRAY + "> " + ChatColor.RED + "You have joined the game.");
    64. }
    65. }
    66. }else
    67. if(args[0].equalsIgnoreCase("leave")){
    68. if(isplaying.contains(true)){
    69. if(playersleft.contains(player.getName())){
    70. player.sendMessage(ChatColor.GREEN + "SG" + ChatColor.GRAY + "> " + ChatColor.RED + "You cannot leave the game!");
    71. }else{
    72. player.sendMessage(ChatColor.GREEN + "SG" + ChatColor.GRAY + "> " + ChatColor.RED + "The game has already start!");
    73. }
    74. }else{
    75. if(qplayers.contains(player.getName())){
    76. player.sendMessage(ChatColor.GREEN + "SG" + ChatColor.GRAY + "> " + ChatColor.RED + "You have left the game.");
    77. qplayers.remove(player.getName());
    78. }else{
    79. player.sendMessage(ChatColor.GREEN + "SG" + ChatColor.GRAY + "> " + ChatColor.RED + "Your not in a game.");
    80. }
    81. }
    82. }else
    83. if(args[0].equalsIgnoreCase("start")){
    84. if(player.isOp() == true){
    85. loadGame();
    86. player.sendMessage(ChatColor.GREEN + "SG" + ChatColor.GRAY + "> " + ChatColor.RED + "You have started the game!");
    87. }
    88. }else if(args[0].equalsIgnoreCase("forceend")){
    89. if(player.isOp() == true){
    90. player.sendMessage(ChatColor.GREEN + "SG" + ChatColor.GRAY + "> " + ChatColor.RED + "You have ended the game!");
    91. setstopped.clear();
    92. setstopped.add(true);
    93. if(qplayers.contains(player.getName())){
    94. player.teleport(player.getWorld().getSpawnLocation());
    95. }else if(playersleft.contains(player.getName())){
    96. player.teleport(player.getWorld().getSpawnLocation());
    97. }
    98. }
    99. }else if(args[0].equalsIgnoreCase("players")){
    100. if(isplaying.contains(true)){
    101. player.sendMessage(ChatColor.RED + "Players remaining: " + ChatColor.GREEN + playersleft.size());
    102. }else{
    103. player.sendMessage(ChatColor.RED + "The game has not started yet!");
    104. }
    105. }
    106. }
    107. return false;
    108. }
    109.  
    110.  
    111. public void loadGame(){
    112. new BukkitRunnable(){
    113. @Override
    114. public void run(){
    115.  
    116. int countdown = 30;
    117. countdown--;
    118. setstopped.clear();
    119. setstopped.add(false);
    120. if(setstopped.contains(true)){
    121. cancel();
    122. playersleft.clear();
    123. qplayers.clear();
    124. isplaying.clear();
    125. isplaying.remove(null);
    126. isplaying.remove(true);
    127. isplaying.add(false);
    128. canhit.clear();
    129. setstopped.clear();
    130. setstopped.add(false);
    131. }
    132. if(countdown == 30){
    133. Bukkit.getServer().broadcastMessage(ChatColor.LIGHT_PURPLE + "A SurvivalGame is ready! Type: /sg join");
    134. }
    135. if(countdown == 20){
    136. Bukkit.getServer().broadcastMessage(ChatColor.LIGHT_PURPLE + "A SurvivalGame is ready! Type: /sg join");
    137. }
    138. if(countdown == 10){
    139. Bukkit.getServer().broadcastMessage(ChatColor.LIGHT_PURPLE + "A SurvivalGame is ready! Type: /sg join");
    140. }
    141. if(countdown == 5){
    142. Bukkit.getServer().broadcastMessage(ChatColor.LIGHT_PURPLE + "Game starts in 5");
    143. }
    144. if(countdown == 4){
    145. Bukkit.getServer().broadcastMessage(ChatColor.LIGHT_PURPLE + "Game starts in 4");
    146. }
    147. if(countdown == 3){
    148. Bukkit.getServer().broadcastMessage(ChatColor.LIGHT_PURPLE + "Game starts in 3");
    149. }
    150. if(countdown == 2){
    151. Bukkit.getServer().broadcastMessage(ChatColor.LIGHT_PURPLE + "Game starts in 2");
    152. }
    153. if(countdown == 1){
    154. Bukkit.getServer().broadcastMessage(ChatColor.LIGHT_PURPLE + "Game starts in 1");
    155. }
    156. if(countdown == 1){
    157. if(qplayers.size() >= 1){
    158. Bukkit.getServer().broadcastMessage(ChatColor.RED + "The game needs more than 2 players to continue!");
    159. cancel();
    160. }
    161. }
    162. if(countdown == 0){
    163. Bukkit.getServer().broadcastMessage(ChatColor.LIGHT_PURPLE + "The HG game has started!");
    164. for(Player players : Bukkit.getOnlinePlayers()){
    165. if(qplayers.contains(players.getName())){
    166. Location pLocation = new Location(Bukkit.getServer().getWorld("world"), 782, 8, 828);
    167. players.teleport(pLocation);
    168. }
    169. }
    170. loadGame2();
    171. cancel();
    172. }
    173.  
    174. }
    175. }.runTaskTimer(plugin, 0, 20);
    176. }
    177.  
    178. public void loadGame2(){
    179. new BukkitRunnable(){
    180. @Override
    181. public void run(){
    182. int ingame = -30;
    183. ingame++;
    184. if(ingame <= 0){
    185. if(setstopped.contains(true)){
    186. playersleft.clear();
    187. qplayers.clear();
    188. isplaying.clear();
    189. isplaying.remove(null);
    190. isplaying.remove(true);
    191. isplaying.add(false);
    192. canhit.clear();
    193. setstopped.clear();
    194. setstopped.add(false);
    195. cancel();
    196. }
    197. }
    198. if(ingame == 1){
    199. for(Player players : Bukkit.getOnlinePlayers()){
    200. if(qplayers.contains(players.getName())){
    201. players.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "You are invincible for 1 minute!");
    202. players.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "You are invincible for 1 minute!");
    203. players.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "You are invincible for 1 minute!");
    204. players.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "You are invincible for 1 minute!");
    205. players.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "You are invincible for 1 minute!");
    206. playersleft.add(players.getName());
    207. isplaying.remove(null);
    208. isplaying.remove(false);
    209. isplaying.add(true);
    210. canhit.put(players.getName(), false);
    211. players.getInventory().clear();
    212. OtherCommands.removeAllKits(players);
    213. players.getInventory().setItem(0, new ItemStack(Material.MUSHROOM_SOUP, 64));
    214. players.getInventory().setArmorContents(null);
    215. players.getInventory().setChestplate(new ItemStack(Material.IRON_CHESTPLATE));
    216. players.getInventory().setLeggings(new ItemStack(Material.IRON_LEGGINGS));
    217. }
    218. }
    219. }
    220. if(ingame == 31){
    221. for(Player players : Bukkit.getOnlinePlayers()){
    222. if(qplayers.contains(players.getName())){
    223. players.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "30 seconds remain until invinciblity is over!");
    224. }
    225. }
    226. }
    227.  
    228. if(ingame == 46){
    229. for(Player players : Bukkit.getOnlinePlayers()){
    230. if(qplayers.contains(players.getName())){
    231. players.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "15 seconds remain until invinciblity is over!");
    232. }
    233. }
    234. }
    235.  
    236. if(ingame == 51){
    237. for(Player players : Bukkit.getOnlinePlayers()){
    238. if(qplayers.contains(players.getName())){
    239. players.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "10 seconds remain until invinciblity is over!");
    240. }
    241. }
    242. }
    243.  
    244. if(ingame == 56){
    245. for(Player players : Bukkit.getOnlinePlayers()){
    246. if(qplayers.contains(players.getName())){
    247. players.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "5 seconds remain until invinciblity is over!");
    248. }
    249. }
    250. }
    251. if(ingame == 57){
    252. for(Player players : Bukkit.getOnlinePlayers()){
    253. if(qplayers.contains(players.getName())){
    254. players.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "4 seconds remain until invinciblity is over!");
    255. }
    256. }
    257. }
    258. if(ingame == 58){
    259. for(Player players : Bukkit.getOnlinePlayers()){
    260. if(qplayers.contains(players.getName())){
    261. players.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "3 seconds remain until invinciblity is over!");
    262. }
    263. }
    264. }
    265. if(ingame == 59){
    266. for(Player players : Bukkit.getOnlinePlayers()){
    267. if(qplayers.contains(players.getName())){
    268. players.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "2 seconds remain until invinciblity is over!");
    269. }
    270. }
    271. }
    272. if(ingame == 60){
    273. for(Player players : Bukkit.getOnlinePlayers()){
    274. if(qplayers.contains(players.getName())){
    275. players.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "1 seconds remain until invinciblity is over!");
    276. }
    277. }
    278. }
    279. if(ingame == 61){
    280. for(Player players : Bukkit.getOnlinePlayers()){
    281. if(qplayers.contains(players.getName())){
    282. players.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "Invinciblity is over! Good luck!");
    283. qplayers.remove(players.getName());
    284. canhit.put(players.getName(), true);
    285. }
    286. }
    287. }
    288. if(ingame == 65){
    289. for(Player players : Bukkit.getOnlinePlayers()){
    290. if(playersleft.contains(players.getName())){
    291. if(playersleft.size() == 1){
    292. Bukkit.getServer().broadcastMessage(ChatColor.DARK_AQUA + "The player " + ChatColor.GREEN + players.getName() + " won the HG game!");
    293. playersleft.clear();
    294. qplayers.clear();
    295. isplaying.clear();
    296. isplaying.remove(null);
    297. isplaying.remove(true);
    298. isplaying.add(false);
    299. canhit.clear();
    300. setstopped.clear();
    301. EconManager.addCredits(players.getName(), 100, players);
    302. players.teleport(players.getWorld().getSpawnLocation());
    303. players.getInventory().clear();
    304. cancel();
    305. }
    306. }
    307. }
    308. }
    309. }
    310. }.runTaskTimer(plugin, 0, 20);
    311. }
    312.  
    313. @EventHandler
    314. public void onPlayerQuit(PlayerQuitEvent event){
    315. Player player = event.getPlayer();
    316. if(playersleft.contains(player.getName())){
    317. playersleft.remove(player.getName());
    318. qplayers.remove(player.getName());
    319. canhit.remove(player.getName());
    320. }else
    321. if(qplayers.contains(player.getName())){
    322. playersleft.remove(player.getName());
    323. qplayers.remove(player.getName());
    324. canhit.remove(player.getName());
    325. }
    326. }
    327.  
    328. @EventHandler
    329. public void onPlayerDeath(PlayerDeathEvent event){
    330. Player player = (Player)event.getEntity();
    331. for(Player players : Bukkit.getServer().getOnlinePlayers()){
    332. if(playersleft.contains(players.getName())){
    333. players.sendMessage(ChatColor.RED + "There are " + ChatColor.GREEN + playersleft.size() + ChatColor.RED + " remaining!");
    334. }
    335. }
    336. if(playersleft.contains(player.getName())){
    337. playersleft.remove(player.getName());
    338. qplayers.remove(player.getName());
    339. canhit.remove(player.getName());
    340. }else
    341. if(qplayers.contains(player.getName())){
    342. playersleft.remove(player.getName());
    343. qplayers.remove(player.getName());
    344. canhit.remove(player.getName());
    345. }
    346.  
    347. }
    348.  
    349. @EventHandler
    350. public void onDamageInGame(EntityDamageByEntityEvent event){
    351. @SuppressWarnings("unused")
    352. Player player = (Player)event.getEntity();
    353. Player damager = (Player)event.getDamager();
    354.  
    355. if(canhit.containsKey(damager.getName())){
    356. if(canhit.containsValue(false)){
    357. event.setCancelled(true);
    358. }else if(canhit.containsValue(true)){
    359. event.setCancelled(false);
    360. }
    361. }
    362. }
    363.  
    364. }
    365.  
    366.  



    Any comments that are not related to this topic to help me will not be accepted and will be reported.

    Good day!
     
  2. Offline

    DxDy

    What does the server console say exactly?
     
  3. Offline

    mrgreen33gamer

    DxDy

    Code:
    17.05 12:23:08 [Disconnect] User mrgreen33gamer has disconnected, reason: Internal server error
    17.05 12:23:08 [Server] INFO at net.minecraft.server.v1_7_R2.ThreadServerApplication.run(SourceFile:618) [craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    17.05 12:23:08 [Server] INFO at net.minecraft.server.v1_7_R2.MinecraftServer.run(MinecraftServer.java:459) [craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    17.05 12:23:08 [Server] INFO at net.minecraft.server.v1_7_R2.MinecraftServer.u(MinecraftServer.java:548) [craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    17.05 12:23:08 [Server] INFO at net.minecraft.server.v1_7_R2.DedicatedServer.v(DedicatedServer.java:250) [craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    17.05 12:23:08 [Server] INFO at net.minecraft.server.v1_7_R2.MinecraftServer.v(MinecraftServer.java:657) [craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    17.05 12:23:08 [Server] INFO at net.minecraft.server.v1_7_R2.ServerConnection.c(SourceFile:134) [craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    17.05 12:23:08 [Server] INFO at net.minecraft.server.v1_7_R2.NetworkManager.a(NetworkManager.java:147) ~[craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    17.05 12:23:08 [Server] INFO at net.minecraft.server.v1_7_R2.PacketPlayInChat.handle(PacketPlayInChat.java:47) ~[craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    17.05 12:23:08 [Server] INFO at net.minecraft.server.v1_7_R2.PacketPlayInChat.a(PacketPlayInChat.java:28) ~[craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    17.05 12:23:08 [Server] INFO at net.minecraft.server.v1_7_R2.PlayerConnection.a(PlayerConnection.java:814) ~[craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    17.05 12:23:08 [Server] INFO at net.minecraft.server.v1_7_R2.PlayerConnection.handleCommand(PlayerConnection.java:957) ~[craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    17.05 12:23:08 [Server] INFO at java.util.logging.Logger.log(Unknown Source) ~[?:1.7.0_51]
    17.05 12:23:08 [Server] INFO at java.util.logging.Logger.doLog(Unknown Source) ~[?:1.7.0_51]
    17.05 12:23:08 [Server] INFO at java.util.logging.Logger.log(Unknown Source) ~[?:1.7.0_51]
    17.05 12:23:08 [Server] INFO at org.bukkit.craftbukkit.v1_7_R2.util.ForwardLogHandler.publish(ForwardLogHandler.java:33) ~[craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    17.05 12:23:08 [Server] INFO at org.apache.logging.log4j.spi.AbstractLogger.error(AbstractLogger.java:609) [craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    17.05 12:23:08 [Server] INFO at org.apache.logging.log4j.core.Logger.log(Logger.java:110) [craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    17.05 12:23:08 [Server] INFO at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:367) [craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    17.05 12:23:08 [Server] INFO at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:406) ~[craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    17.05 12:23:08 [Server] INFO at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:425) ~[craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    17.05 12:23:08 [Server] INFO at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:101) ~[craftbukkit_dev_3033.jar:git-Bukkit-1.7.2-R0.3-9-g8e87ff5-b3033jnks]
    
     
  4. Offline

    DxDy

    It would appear as though you're using a development build of craftbukkit to run the server. Have you been able to reproduce the error on the beta-build?

    (At least that is what I assume from craftbukkit_dev.jar, haven't actually checked the version number^^)
     
  5. Offline

    mrgreen33gamer

    What does the version have to do with my code?

    DxDy Please respond. And BUMP!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
  6. Offline

    coasterman10

    Try using a newer version or build. This error is originating from the server, not your code.
     
  7. Offline

    mrgreen33gamer

    coasterman10 THANK YOU! Everything works but, whenever I type: /sg start. The game doesn't start, for some reason it has to do with the Int. Any help with that?
     
  8. Offline

    mrgreen33gamer

    LEE BUMP!!

    coasterman10 DxDy | Please any help :(

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
  9. Offline

    DxDy

    What steps have you taken to debug the problem?
     
  10. Offline

    Maurdekye

  11. Offline

    mrgreen33gamer

    DxDy and Maurdekye

    I am just having a problem were if I type: /sg start, the game doesn't start. I am getting an Error in the console...
    OPPP! Wrong error :p
     
  12. Offline

    Maurdekye

    mrgreen33gamer what
    If there's an error in the console, then there's a stacktrace. If so, show it to us, or we can't help you.
     
  13. Offline

    mrgreen33gamer

    There is no error -_-.

    Forgot. Maurdekye

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
  14. Offline

    DxDy

    I can only reiterate my previous post: What steps have you taken to debug the problem?
    Also, what is the expected behavior?
     
  15. Offline

    Garris0n

    Why do you have lists of booleans? What are those even supposed to do?

    And why would anyone, ever use "== true" in an if statement?
     
  16. Offline

    mrgreen33gamer

    I removed a public int outside of the load game part. Once I added a INT into the load game part then the game didn't work. Whenever I type the command: /sg start - The game doesn't start. It just sits there.
     
  17. Offline

    mrgreen33gamer

  18. Offline

    mrgreen33gamer

    Is this is the right bump time? BYMP!
     
  19. Offline

    zackpollard

    What. In gods name. Is wrong with you.
    public static ArrayList<Boolean> isplaying = new ArrayList<Boolean>();
    public static ArrayList<Boolean> setstopped = new ArrayList<Boolean>();I'm done.
     
    L33m4n123 likes this.
  20. Offline

    L33m4n123

    learn java and return to your code and you will find the issue
     
    zackpollard likes this.
  21. Offline

    fireblast709

    mrgreen33gamer remove all your static keywords, and for the love of all, learn Java.
     
    jimuskin, L33m4n123 and zackpollard like this.
  22. Offline

    JBoss925

    Lol I started dying when I saw that boolean arraylist. If you're trying to store booleans for players use a hash map.
     
    L33m4n123 likes this.
  23. Offline

    zackpollard

    I think he was just trying to store a single boolean...
     
  24. Offline

    Rocoty

    JBoss925 Actually, if you're gonna store booleans for players you should use a List, but instead of a List of Booleans it would have to be a List of Players. The boolean part comes in when you check to see if the Player is in the list.
     
    xYourFreindx and zackpollard like this.
  25. Offline

    JBoss925

    That could work as well. :D
     
  26. Offline

    mrgreen33gamer

    fireblast709
    First of all, you can't assume someone's life just like that. Second of all, I know my Java, if you think you know it, then solve this. Beat that.

    zackpollard JBoss925 Rocoty and L33m4n123 ----

    My code is specially designed for this game. Nothing is wrong with anything but the command that starts the code. If you look and think logically, then you can solve this, removing Statics isn't going to do nothing. This doesn't solve the code I have. And booleans are stored to create a true/false statement to get the game.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
  27. Offline

    L33m4n123

    There is so much wrong with the code. And if you don't see they I really suggest to take a step back again and Learn more java
     
  28. Offline

    mrgreen33gamer

    L33m4n123

    OK first of all. How does learning Java solve this? This isn't helping my problem, you people are making Hippocrates from yourselves. That's not helping anyone. If you can't help me with this, then please go else where. I am trying to get help here, I am not trying to get told what to do in general. I am trying to solve this code so that I can move on with my life, if you can't accept that. Go else where.
     
  29. Offline

    Rocoty

    Why can't you though?

    How does learning java solve it? Am I really reading this? You don't think learning to properly use the language you are trying to use, will help you?

    There is no help in us fixing your piece of code. If we fix your piece of code you will learn nothing and you will come back from here with nothing. We are trying to help you. We are trying to make you see that you need to properly know how to use the tool you have at hand. There is no easy way. There is only learning Java and become a master at what you're doing.

    If you're not gonna be thankful for the advice you've been given there are numerous ways to exit this site.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
  30. Offline

    jimuskin

    Ok then... Where do I start?

    First - check your bracket placements. 'Nuff said.

    Second - why use Arraylists for a boolean? Just use a boolean...

    Third - why statics? Makes everything inconvenient....

    Fourth - if you disagree with what I said, please go back and learn java...
     
    Rocoty likes this.
Thread Status:
Not open for further replies.

Share This Page