Thread: Donator Only [PI]

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 Donator Only [PI] 
    RageXile Owner ;)
    Aim High's Avatar
    Join Date
    Feb 2012
    Posts
    366
    Thanks given
    162
    Thanks received
    28
    Rep Power
    28
    Can somebody tell me how to make it to where only donators can do a certain clickingbutton action? I'm still learning.

    Eg.
    Code:
    			case ####: //donator option
    				c.whateverIwantThedonatortodo();
    				c.whateverIwantThedonatortodo;
    				c.sendMessage("You must be donator to open this!");
    			break;
    Reply With Quote  
     

  2. #2  
    Cash Back Guaranteed!


    Join Date
    Sep 2012
    Age
    29
    Posts
    246
    Thanks given
    36
    Thanks received
    42
    Rep Power
    164
    First of is your Donator status a boolean or an integer.

    if (isDonator) {
    What Ever;
    } else {
    c.sendMessage("You need to be a donator to use this feature.");
    }

    if (isDonator == 1) {
    What Ever;
    } else {
    c.sendMessage("You need to be a donator to use this feature.");
    }
    Spoiler for Rune Plus:
    Reply With Quote  
     

  3. #3  
    Donator


    Join Date
    Sep 2011
    Posts
    2,730
    Thanks given
    1,150
    Thanks received
    907
    Rep Power
    668
    If you don't use the isDonator like most PI's do, you could do it through playerRights.

    Assuming playerRights for donators = 4.

    Code:
    	case ####: //donator option
    		if (c.playerRights >= 1 && c.playerRights <= 4) {
    			c.whateverIwantThedonatortodo();
    		} else {
    			c.sendMessage("You need to be a donator to open this!");
    		}
    	break;
    Reply With Quote  
     

  4. Thankful users:


  5. #4  
    RageXile Owner ;)
    Aim High's Avatar
    Join Date
    Feb 2012
    Posts
    366
    Thanks given
    162
    Thanks received
    28
    Rep Power
    28
    Quote Originally Posted by Dawn_ View Post
    First of is your Donator status a boolean or an integer.

    if (isDonator) {
    What Ever;
    } else {
    c.sendMessage("You need to be a donator to use this feature.");
    }

    if (isDonator == 1) {
    What Ever;
    } else {
    c.sendMessage("You need to be a donator to use this feature.");
    }
    Spoiler for error:
    src\server\model\players\packets\ClickingButtons.j ava:820: cannot find symbol
    symbol : variable isDonator
    location: class server.model.players.packets.ClickingButtons
    if (isDonator) {
    ^
    src\server\model\players\packets\ClickingButtons.j ava:825: cannot find symbol
    symbol : variable isDonator
    location: class server.model.players.packets.ClickingButtons
    if (isDonator == 1) {
    ^
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    Press any key to continue . . .

    Still need.
    Reply With Quote  
     

  6. #5  
    Cash Back Guaranteed!


    Join Date
    Sep 2012
    Age
    29
    Posts
    246
    Thanks given
    36
    Thanks received
    42
    Rep Power
    164
    Lol my god are you dumb you have to use your that just an example do you know how to code.

    Go to your player.java and search for your donator int or boolean
    Spoiler for Rune Plus:
    Reply With Quote  
     

  7. #6  
    Donator


    Join Date
    Sep 2011
    Posts
    2,730
    Thanks given
    1,150
    Thanks received
    907
    Rep Power
    668
    Quote Originally Posted by Dawn_ View Post
    Lol my god are you dumb you have to use your that just an example do you know how to code.

    Go to your player.java and search for your donator int or boolean
    He obviously doesn't fucking have it.

    Here you go, Aim High, if you need in the future. Add into Player.java where you see other booleans. Make sure you don't add it inside any methods.

    Code:
    public boolean isDonator;
    Reply With Quote  
     

  8. Thankful user:


  9. #7  
    RageXile Owner ;)
    Aim High's Avatar
    Join Date
    Feb 2012
    Posts
    366
    Thanks given
    162
    Thanks received
    28
    Rep Power
    28
    Quote Originally Posted by Lystuya View Post
    If you don't use the isDonator like most PI's do, you could do it through playerRights.

    Assuming playerRights for donators = 4.

    Code:
    	case ####: //donator option
    		if (c.playerRights >= 1 && c.playerRights <= 4) {
    			c.whateverIwantThedonatortodo();
    		} else {
    			c.sendMessage("You need to be a donator to open this!");
    		}
    	break;
    Nothing happened?
    Reply With Quote  
     

  10. #8  
    Donator


    Join Date
    Sep 2011
    Posts
    2,730
    Thanks given
    1,150
    Thanks received
    907
    Rep Power
    668
    Quote Originally Posted by Aim High View Post
    Nothing happened?
    Make sure you actually have
    Code:
    c.whateverIwantThedonatortodo();
    Replaced with an actual method.

    Also make sure the account you're using is either rights 1-4. Otherwise, you'll get the message.

    You need to be a donator to open this!
    Reply With Quote  
     

  11. #9  
    RageXile Owner ;)
    Aim High's Avatar
    Join Date
    Feb 2012
    Posts
    366
    Thanks given
    162
    Thanks received
    28
    Rep Power
    28
    Quote Originally Posted by Lystuya View Post
    Make sure you actually have
    Code:
    c.whateverIwantThedonatortodo();
    Replaced with an actual method.

    Also make sure the account you're using is either rights 1-4. Otherwise, you'll get the message.
    I did.
    Code:
    case 93121: //donator option
            if (c.playerRights >= 1) {
    				c.getItems().addItem(1079, 1); //For testing
            } else {
                c.sendMessage("You need to be a donator to open this!");
            }
        break;
    Reply With Quote  
     

  12. #10  
    RageXile Owner ;)
    Aim High's Avatar
    Join Date
    Feb 2012
    Posts
    366
    Thanks given
    162
    Thanks received
    28
    Rep Power
    28
    Quote Originally Posted by Lystuya View Post
    If you don't use the isDonator like most PI's do, you could do it through playerRights.

    Assuming playerRights for donators = 4.

    Code:
    	case ####: //donator option
    		if (c.playerRights >= 1 && c.playerRights <= 4) {
    			c.whateverIwantThedonatortodo();
    		} else {
    			c.sendMessage("You need to be a donator to open this!");
    		}
    	break;
    Thanks, I just forgot to return it.
    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: 3
    Last Post: 03-22-2013, 06:02 PM
  2. Replies: 2
    Last Post: 08-14-2012, 03:13 AM
  3. Making items donator only/non donator
    By Coding Maniac in forum Help
    Replies: 3
    Last Post: 09-11-2011, 06:19 PM
  4. Replies: 5
    Last Post: 08-10-2011, 07:49 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •