Need help using a delay

Discussion in 'Plugin Development' started by zack6849, Aug 14, 2012.

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

    zack6849

    Essentially i have an option in my configuration file for my plugin that is going to accept a value in server ticks, however how would i go about using an into from my config to do this? it needs to end in L and if i try getConfig().getString("defualts.time") it complains because timers wont accepts strings, i also tried making a new int variable int time = getConfig.getInt("defualts.time");
    however if in the timer i did time or time + L it wont work either, so how would i go about doing this?
     
  2. You don't need to use the "L" (which obviously you don't understand what it stands for)... you can just use getInt() because I don't think you'll be using huge numbers ... or if you do, you can use getLong() to store a long instead of int.
     
  3. Offline

    zack6849

    Oh so the L at the end of the number isn't required? o_0
     
  4. No... it never was, it accepts numbers/integers, those letters after them specify what type of number it is... L is for long, D is for double, F is for float, etc, but they're not required.
     
  5. Offline

    zack6849

    oh okay! thanks for clearing that up for me! :D
     
  6. Offline

    TheSmallBones

    Also: if you want it be more user friendly, have the int's string named Delay(seconds) or something, then in your delay have delay * 20.
     
  7. Offline

    zack6849

    wow, that would be a tad more simple, so i could do like time * 20?
     
  8. When you get it you add * 20 after it...
    Code:
    int time = (getConfig.getInt("time...") * 20);
    ... you really should learn basic Java syntax :)
     
  9. Offline

    zack6849

    i know >_> thanks though
     
Thread Status:
Not open for further replies.

Share This Page