Thread: [PI]Vote4Point Little Help![PI]

Results 1 to 5 of 5
  1. #1 [PI]Vote4Point Little Help![PI] 
    PhoenixPk - Nothing is impossible
    T3rminator's Avatar
    Join Date
    Feb 2012
    Posts
    327
    Thanks given
    31
    Thanks received
    14
    Rep Power
    16
    Hello there, i'm almsot done with my vote4point system.
    I just need little help, i want so after you typed ::vote and voted then you can do "::claim" and get 1 vote point.

    Can someone tell me the code "::claim" with 1 vote point please

    Anyone knows the code or knows where to add it?



    And i need to make so players only can do ::claim every 24 hours
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Sep 2009
    Posts
    904
    Thanks given
    139
    Thanks received
    55
    Rep Power
    0
    Code:
    	if (playerCommand.equalsIgnoreCase("Reward")) {
    			if(c.checkVotes(c.playerName)) {
    			c.votePoints += 1; // Change the 1 to how ever many points.
    				c.sendMessage("Enjoy your voting reward!");
    			}else {
    				c.sendMessage("You need to vote before using this command.");
    					}
    				}
    Reply With Quote  
     

  3. #3  
    PhoenixPk - Nothing is impossible
    T3rminator's Avatar
    Join Date
    Feb 2012
    Posts
    327
    Thanks given
    31
    Thanks received
    14
    Rep Power
    16
    Thanks, but can players do this after they typed ::vote?

    Or they can do that whever they want without ::vote?
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Sep 2009
    Posts
    904
    Thanks given
    139
    Thanks received
    55
    Rep Power
    0
    Quote Originally Posted by T3rminator View Post
    Thanks, but can players do this after they typed ::vote?

    Or they can do that whever they want without ::vote?

    Code:
    public static void checkVote(Client c) {
            try {
                if(c.getItems().freeSlots() > 0) {
                    //Statement stmt = con.createStatement();
                    ResultSet rs = query("SELECT id,item_id, item_amount FROM `items` WHERE `username`= '" + c.playerName + "' AND `claimed`= '0'");
                    if(rs.next()) {
                        int rowid = rs.getInt("id");
                        int itemid = rs.getInt("item_id");
                        int amount = rs.getInt("item_amount");
                        query("UPDATE `items` SET `claimed` = 1 WHERE `username` = '" + c.playerName + "' AND `id`='" + rowid + "'");
                        c.getItems().addItem(itemid, amount);
                        c.sendMessage("You receive "+amount+" X "+c.getItems().getItemName(itemid)+".");
                    } else {
                        c.sendMessage("No items waiting for you.");
                    }
                } else {
                    c.sendMessage("Please make space for your items.");
                }
            } catch (SQLException ex) {
                System.out.println(ex);
            }
        }

    In mysqlmanager
    Reply With Quote  
     

  5. #5  
    PhoenixPk - Nothing is impossible
    T3rminator's Avatar
    Join Date
    Feb 2012
    Posts
    327
    Thanks given
    31
    Thanks received
    14
    Rep Power
    16
    Thanks i fixed this problem, but now i jarred my client and made webclient, and when people try's the webclient it say's "Error: Click here for detalis"

    But the webclient works for me perfecrly but not works for other people...

    And same problem with the client, when i use client it works perfectly, but when people uses it, it says "can not find main class file"

    Please help me
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •