Thread: 24 hour vote command

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1 24 hour vote command 
    Registered Member
    Join Date
    Jan 2011
    Posts
    118
    Thanks given
    31
    Thanks received
    1
    Rep Power
    4
    i need help with making a 24 hour vote command

    i need this command making so it can only be done every 24 hours

    Code:
    				if(playerCommand.startsWith("vote")) {
    					c.getPA().sendFrame126("www.google.com", 12000);
    					c.getItems().addItem(6199,1);
    					c.sendMessage("You Will Have To Wait 24 Hours To vote Again");
    			}
    thanks
    Reply With Quote  
     

  2. #2  
    Respected Member


    kLeptO's Avatar
    Join Date
    Dec 2006
    Age
    25
    Posts
    2,955
    Thanks given
    1,183
    Thanks received
    754
    Discord
    View profile
    Rep Power
    3084
    In Client.java declare:
    Code:
    public long lastVote = System.currentTimeMillis()+86400001;
    Open PlayerSave.java and search for:
    Code:
     else if (token.equals("character-rights")) {
    						p.playerRights = Integer.parseInt(token2);
    					}
    Add this below it:
    Code:
     else if (token.equals("lastvote")) {
    						p.lastVote = Integer.parseInt(token2);
    					}
    Now in PlayerSave.java search for:
    Code:
    characterfile.write(Integer.toString(p.playerRights), 0, Integer.toString(p.playerRights).length());
    characterfiile.newLine();
    And add this below it:
    Code:
    			characterfile.write("lastvote = ", 0, 19);
    			characterfile.write(Long.toString(p.lastVote), 0, Long.toString(p.lastVote).length());
    			characterfile.newLine();
    Now replace your command with this:
    Code:
    			if(playerCommand.startsWith("vote")) {
    				if(System.currentTimeMillis()-c.lastVote >= 86400000) {
    					c.getPA().sendFrame126("www.google.com", 12000);
    					c.getItems().addItem(6199,1);
    				} else {
    					c.sendMessage("You Will Have To Wait 24 Hours To vote Again");
    				}
    			}
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member
    Join Date
    Jan 2011
    Posts
    118
    Thanks given
    31
    Thanks received
    1
    Rep Power
    4
    src\server\model\players\PlayerSave.java:79: ';' expected
    p.lastVote = Integer.parseInt(to
    ken2)

    ^
    1 error
    Press any key to continue . . .


    i got this error
    Reply With Quote  
     

  5. #4  
    Registered Member Math Class's Avatar
    Join Date
    Oct 2010
    Age
    25
    Posts
    150
    Thanks given
    27
    Thanks received
    23
    Rep Power
    7
    Quote Originally Posted by mTi Connor View Post
    src\server\model\players\PlayerSave.java:79: ';' expected
    p.lastVote = Integer.parseInt(to
    ken2)

    ^
    1 error
    Press any key to continue . . .


    i got this error
    If you can't fix that then please, just stop.

    ^Made by Kid Kash.
    Reply With Quote  
     

  6. #5  
    Registered Member
    Join Date
    Jan 2011
    Posts
    118
    Thanks given
    31
    Thanks received
    1
    Rep Power
    4
    Quote Originally Posted by Math Class View Post
    If you can't fix that then please, just stop.
    man i new some dick would comment
    Reply With Quote  
     

  7. #6  
    Banned

    Join Date
    Nov 2010
    Posts
    687
    Thanks given
    16
    Thanks received
    47
    Rep Power
    0
    ur afucking idiot and just add ; to the end
    Reply With Quote  
     

  8. #7  
    Registered Member Math Class's Avatar
    Join Date
    Oct 2010
    Age
    25
    Posts
    150
    Thanks given
    27
    Thanks received
    23
    Rep Power
    7
    Quote Originally Posted by mTi Connor View Post
    man i new some dick would comment
    If you would actually read what the error states, you would be able to fix it yourself. We aren't here to fucking spoon feed you.

    ^Made by Kid Kash.
    Reply With Quote  
     

  9. #8  
    Banned

    Join Date
    May 2010
    Age
    25
    Posts
    1,023
    Thanks given
    199
    Thanks received
    87
    Rep Power
    0
    Quote Originally Posted by Math Class View Post
    If you can't fix that then please, just stop.
    Newfag troller be goin bye bye.

    Quote Originally Posted by Cigam the hobo View Post
    ur afucking idiot and just add ; to the end
    And another...
    Reply With Quote  
     

  10. #9  
    Registered Member
    Join Date
    Mar 2011
    Posts
    18
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    thanks kelopt
    Reply With Quote  
     

  11. #10  
    Registered Member
    CTucker's Avatar
    Join Date
    Oct 2008
    Posts
    2,422
    Thanks given
    263
    Thanks received
    281
    Rep Power
    343
    What if the server crashes, then... if its offline for 5 hours, thats 5 extra hours everyone has to wait.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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: 13
    Last Post: 06-04-2011, 07:38 PM
  2. [5$][PI]24 Hour Command
    By Division in forum Help
    Replies: 0
    Last Post: 10-01-2010, 01:57 PM
  3. getting 50-60m PER HOUR!
    By Snow Cat123 in forum Guides
    Replies: 15
    Last Post: 05-24-2010, 07:05 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
  •