Thread: Need help with a command please!

Results 1 to 7 of 7
  1. #1 Need help with a command please! 
    Registered Member ScoobyDoo's Avatar
    Join Date
    Mar 2013
    Posts
    132
    Thanks given
    18
    Thanks received
    2
    Rep Power
    10
    hey all i'm just wondering if someone could help me with
    like i made a command :ice but i would wanna put a limit of 5 dices per day
    how do u add a limit to the command? could someone help me pls! much appreciated
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jul 2012
    Age
    29
    Posts
    85
    Thanks given
    2
    Thanks received
    4
    Rep Power
    11
    for limit add

    public int diceLimit;

    if (diceLimit >= 5)) {
    c.sendMessage("wait another day to dice again.");
    return;
    }

    and when u can dice add
    c.diceLimit += 1;
    in the method

    and add it in player save

    dont copy that ^ just wrote it quickly
    this does not include the 24 hour timer
    Reply With Quote  
     

  3. #3  
    Registered Member ScoobyDoo's Avatar
    Join Date
    Mar 2013
    Posts
    132
    Thanks given
    18
    Thanks received
    2
    Rep Power
    10
    hmm could u add the whole command pls + the timer?
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jul 2012
    Age
    29
    Posts
    85
    Thanks given
    2
    Thanks received
    4
    Rep Power
    11
    Code:
    if(playerCommand.startsWith("dice")) {
    if (diceLimit >= 5)) {
    c.sendMessage("wait another day to dice again.");
    return;
    }
    if(System.currentTimeMillis() - c.Delay > 86400000) {
    c.diceLimit += 1;
    c.Delay = System.currentTimeMillis();
    //add your dicing code here
    } else {
    c.sendMessage("It has not been 24 hours yet. You must wait 24 hours before voting again!");
    }
    not sure if this works

    dont forget to add
    public int diceLimit;
    in player.java
    you also need to reset diceLimit to 0 somehow
    Reply With Quote  
     

  5. #5  
    Registered Member ScoobyDoo's Avatar
    Join Date
    Mar 2013
    Posts
    132
    Thanks given
    18
    Thanks received
    2
    Rep Power
    10
    Quote Originally Posted by Hunger Games View Post
    Code:
    if(playerCommand.startsWith("dice")) {
    if (diceLimit >= 5)) {
    c.sendMessage("wait another day to dice again.");
    return;
    }
    if(System.currentTimeMillis() - c.Delay > 86400000) {
    c.diceLimit += 1;
    c.Delay = System.currentTimeMillis();
    //add your dicing code here
    } else {
    c.sendMessage("It has not been 24 hours yet. You must wait 24 hours before voting again!");
    }
    not sure if this works

    dont forget to add
    public int diceLimit;
    in player.java
    you also need to reset diceLimit to 0 somehow
    wot do you mean with add your dicing code here? u mean the command ? or
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Jul 2012
    Age
    29
    Posts
    85
    Thanks given
    2
    Thanks received
    4
    Rep Power
    11
    add the dicing "system" there.
    Reply With Quote  
     

  7. Thankful user:


  8. #7  
    Registered Member ScoobyDoo's Avatar
    Join Date
    Mar 2013
    Posts
    132
    Thanks given
    18
    Thanks received
    2
    Rep Power
    10
    sorry but wot u mean by system?
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 4
    Last Post: 08-04-2009, 05:03 PM
  2. Need help with this command
    By jat1802 in forum Help
    Replies: 7
    Last Post: 02-21-2009, 03:08 AM
  3. Need help with clientside commands
    By Colby in forum Help
    Replies: 5
    Last Post: 01-26-2009, 05:08 AM
  4. Need help with a command..
    By W x 3 in forum Help
    Replies: 10
    Last Post: 10-27-2008, 08:35 PM
  5. need help with port forwarding please help
    By System of a down in forum Chat
    Replies: 0
    Last Post: 05-13-2008, 11:32 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •