Thread: [PI] Adding Ranks

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 [PI] Adding Ranks 
    Fuck the rest join the best, WoR
    Jinx's Avatar
    Join Date
    Oct 2010
    Posts
    635
    Thanks given
    99
    Thanks received
    65
    Rep Power
    364

    This is going to be a tutorial for adding ranks to your players in the character files. This is a super easy task to perform once you get the hang of it. If you have any questions about this either reply to this thread, private message me, or send me an email at '[email protected]'.


    Step 1:

    In your Player.java folder
    Src > Server > Model > Players > Player.java

    Search:

    Code:
    public int playerRights;
    Add:
    Code:
    public int donator;

    Step 2:

    In your PlayerSave.java folder
    Src > Server > Model > Players > PlayerSave.java

    Search:

    Code:
    p.playerRights = Integer.parseInt(token2);
    Add:
    Code:
    } else if (token.equals("character-donator")) {
    p.donator =  Integer.parseInt(token2);

    Step 3:

    In your PlayerSave.java folder
    Src > Server > Model > Players > PlayerSave.java

    Search:

    Code:
    			characterfile.write("character-rights = ", 0, 19);
    			characterfile.write(Integer.toString(p.playerRights), 0, Integer.toString(p.playerRights).length());
    			characterfile.newLine();
    Add:
    Code:
    			characterfile.write("character-donator = ", 0, 20);
    			characterfile.write(Integer.toString(p.donator), 0, Integer.toString(p.donator).length());
    			characterfile.newLine();
    The wor has begun.


    Reply With Quote  
     

  2. #2  
    RuneFatality

    Join Date
    May 2009
    Age
    24
    Posts
    2,355
    Thanks given
    1,099
    Thanks received
    388
    Rep Power
    531
    Not a rank yet. You have to make something of it to make it a rank.
    Reply With Quote  
     

  3. #3  
    Fuck the rest join the best, WoR
    Jinx's Avatar
    Join Date
    Oct 2010
    Posts
    635
    Thanks given
    99
    Thanks received
    65
    Rep Power
    364
    Quote Originally Posted by PenisCount++ View Post
    Not a rank yet. You have to make something of it to make it a rank.
    What do you mean "Make something of it"? All that it is, basically, you add this code, and then if you want to make a command for donators only, you will restrict it so that only people with "character-donator = 1" in their character file can use the command. To me, that sounds like a rank.
    The wor has begun.


    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Oct 2010
    Posts
    1,731
    Thanks given
    56
    Thanks received
    97
    Rep Power
    0
    ^ because it is a rank..
    Reply With Quote  
     

  5. #5  
    Fuck the rest join the best, WoR
    Jinx's Avatar
    Join Date
    Oct 2010
    Posts
    635
    Thanks given
    99
    Thanks received
    65
    Rep Power
    364
    Quote Originally Posted by brianm23 View Post
    ^ because it is a rank..
    Thats exactly what I am trying to explain.
    The wor has begun.


    Reply With Quote  
     

  6. #6  
    RuneFatality

    Join Date
    May 2009
    Age
    24
    Posts
    2,355
    Thanks given
    1,099
    Thanks received
    388
    Rep Power
    531
    No. it's an int/boolean saving to your character. You have to make something of it, e.g donator island.
    Reply With Quote  
     

  7. Thankful user:


  8. #7  
    Banned

    Join Date
    Oct 2010
    Posts
    717
    Thanks given
    82
    Thanks received
    131
    Rep Power
    0
    Quote Originally Posted by PenisCount++ View Post
    No. it's an int/boolean saving to your character. You have to make something of it, e.g donator island.
    Code:
                                   case 108003:
    				if (c.character-donator == 1 || c.playerRights >= 1) {
    				c.setSidebarInterface(4, 27620);
    				} else {
    				c.sendMessage("You must be an donator to view this tab!");
    				return;				
    				}
    				break;
    
    			      case 107231:
    				if (c.character-donator == 1 || c.playerRights >= 1) {
    				c.getPA().spellTeleport(2036, 4525, 0);
    				c.sendMessage("You teleported to donator-zone a place to chill/relax, theres also alot of benefits.");
    				} else {
    				c.sendMessage("You must be an donator to teleport to the donator-zone!");
    				return;				
    				}
    				break;
    Reply With Quote  
     

  9. #8  
    Fuck the rest join the best, WoR
    Jinx's Avatar
    Join Date
    Oct 2010
    Posts
    635
    Thanks given
    99
    Thanks received
    65
    Rep Power
    364
    This is a rank. You need this to be able to make things for donators only.
    The wor has begun.


    Reply With Quote  
     

  10. #9  
    Botnet admin

    HaVoK0321's Avatar
    Join Date
    Jan 2009
    Posts
    551
    Thanks given
    51
    Thanks received
    23
    Rep Power
    247
    Easy but good job.
    Reply With Quote  
     

  11. Thankful user:


  12. #10  
    Fuck the rest join the best, WoR
    Jinx's Avatar
    Join Date
    Oct 2010
    Posts
    635
    Thanks given
    99
    Thanks received
    65
    Rep Power
    364
    Quote Originally Posted by TsGh MiKe View Post
    Easy but good job.
    Of course its easy. This guide is pretty much just for everyone who is new to coding. When I started, I was pretty proud to do this without a guide. I really just made the post because of a different guide that I created.
    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. Adding "ranks" such as donator or members.(For new coders)
    By ¤~W.I.L.L~¤ in forum Configuration
    Replies: 89
    Last Post: 04-04-2013, 11:14 PM
  2. [525] Adding ranks Owner, Co owner, donater in yell
    By Ramsin in forum Configuration
    Replies: 20
    Last Post: 10-23-2010, 01:37 AM
  3. [PI] Adding New Ranks (donor etc.) [PI]
    By farmerscape in forum Help
    Replies: 1
    Last Post: 09-24-2010, 02:10 AM
  4. Adding Ranks Next To Chatbox Name.
    By Moronic in forum Help
    Replies: 7
    Last Post: 07-10-2010, 10:44 PM
  5. Ranks
    By messiaH in forum Suggestions
    Replies: 13
    Last Post: 10-06-2008, 05:05 PM
Tags for this Thread

View Tag Cloud

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