Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • ASDss: where do u download source and clients now
      August 18, 2017, 10:39:31 PM
    • ASDss: yo
      August 18, 2017, 10:39:20 PM
    • dan v jad: click me 4 da fun ;)[link]
      August 18, 2017, 04:39:58 PM
    • stCky: Palidinho is your OpenGL (was it OpenGL?) stuff open source anywhere?
      August 16, 2017, 09:07:22 PM
    • Travas:BUILD THE WALL
      August 15, 2017, 09:28:49 PM
    • Travas: i have ass cancer
      August 15, 2017, 09:23:29 PM
    • stCky: what are the fudge are you tryna ask?
      August 15, 2017, 08:21:35 PM
    • bader: what are the rsps community alive ?
      August 15, 2017, 05:46:16 PM
    • bader: yo guys
      August 15, 2017, 05:46:08 PM
    • Spacehost:[link] Updated our thread :)
      August 15, 2017, 09:40:34 AM
    • Adaro: The client is in Download section at Homepage
      August 15, 2017, 01:09:20 AM
    • FaTe_Of_GoDs: where do i get the client?????????????
      August 14, 2017, 05:23:14 PM
    • stCky: can anyone help me? I cant login to the shoutbox
      August 13, 2017, 05:45:15 PM
    • drubrkletern: appeal denied
      August 13, 2017, 02:35:27 PM
    • King_Trout:[link]
      August 13, 2017, 11:17:12 AM
    • Cole1497: no sorry
      August 13, 2017, 10:27:14 AM
    • ayz: yo can anyone explain something to me
      August 13, 2017, 08:08:51 AM
    • coolking12: Hi
      August 13, 2017, 04:16:06 AM
    • stCky: n+1
      August 11, 2017, 06:09:24 PM
    • PalidinoDH: How many more pages are going to show errors before this dude gets on and fixes shit
      August 11, 2017, 04:57:00 PM

    Author Topic: [PI] Ranks/New Ranks  (Read 509 times)

    0 Members and 1 Guest are viewing this topic.

    Offlinemalimt

    • Member
    • ****
    • Posts: 472
    • Thanks: +0/-0
      • View Profile
    [PI] Ranks/New Ranks
    « on: May 09, 2015, 07:11:14 PM »
    Hello there, I was thinking about ranks today and I decided to try and make a new rank and also edit a current existing rank "Donator"

    I was wondering how I could make a new rank? Like a whole completely new rank?? "EXAMPLE; Helper rank"

    I also have another question, I want to add super-donator and extreme-donator... but, I want to do it in a more convienient way.... Which would be something like this, if it's possible...
    Code: [Select]
    isDonator = 0 //non-donator
    isDonator = 1 //donator-level1 - [ Donor ]
    isDonator = 2 //donator-level2 - [ SuperDonor ]
    isDonator = 3 //donator-level3 - [ ExtremeDonor ]
    Is it possible to do that? and if so, then how?! I've been looking at some tuts, couldn't really find anything
    on it.
    Any and every help is greatly appreciated! [INSDIAX Source]
    « Last Edit: May 09, 2015, 07:15:54 PM by malimt »

    OfflineWarTusk-RSPS

    • Member
    • ***
    • Posts: 186
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Ranks/New Ranks
    « Reply #1 on: May 09, 2015, 07:22:33 PM »
    copied tutorial to lazy to type it out. It would not let me post link for some weird reason. Credit to Jinx
    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();
    "Speaking of if you want me to stop flooding your server and want a solution on how to prevent it, I'll start the negotiations at 500$. A drop in the bucket for you I suppose. And I'll help fix the XSS vulnerabilities for 100$ each."

    -Sini


    Offlinemalimt

    • Member
    • ****
    • Posts: 472
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Ranks/New Ranks
    « Reply #2 on: May 09, 2015, 07:34:37 PM »
    copied tutorial to lazy to type it out. It would not let me post link for some weird reason. Credit to Jinx
    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();
    Thanks for the reply... I believe this is to create a new rank?
    Which is what i'm looking for. However, I am also looking to edit my "Donator" rank

    Code: [Select]
    " I also have another question, I want to add super-donator and extreme-donator...
    but, I want to do it in a more convienient way....
    Which would be something like this, if it's possible... "
    isDonator = 0 //non-donator
    isDonator = 1 //donator-level1 - [ Donor ]
    isDonator = 2 //donator-level2 - [ SuperDonor ]
    isDonator = 3 //donator-level3 - [ ExtremeDonor ]

    OfflineWarTusk-RSPS

    • Member
    • ***
    • Posts: 186
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Ranks/New Ranks
    « Reply #3 on: May 09, 2015, 08:01:11 PM »
    isDonator = 0 //non-donator
    isDonator = 1 //donator-level1 - [ Donor ]
    isDonator = 2 //donator-level2 - [ SuperDonor ]
    isDonator = 3 //donator-level3 - [ ExtremeDonor ]

    That is possible.

    Example Different Donator Islands depending on the number of isDonator they are.

    if (playerCommand.equals("Donatorzone") && (c.isDonator == 3) {
       c.getPA().startTeleport(3333, 3333, 3, "modern");
             c.sendMessage("Welcome to the Extreme Donator Area");
          }

    if (playerCommand.equals("Donatorzone") && (c.isDonator == 2) {
       c.getPA().startTeleport(2222, 2222, 2, "modern");
             c.sendMessage("Welcome to the Super Donator Area");
          }

    if (playerCommand.equals("Donatorzone") && (c.isDonator == 1) {
       c.getPA().startTeleport(1111, 1111, 1, "modern");
             c.sendMessage("Welcome to the Basic Donating Area");
          }


    Now you just have to make sure each privilege is like how it is on those Bold parts.And That it equals the number of donator you are. And then on your side you would just change it for them which number of donator they are.
    "Speaking of if you want me to stop flooding your server and want a solution on how to prevent it, I'll start the negotiations at 500$. A drop in the bucket for you I suppose. And I'll help fix the XSS vulnerabilities for 100$ each."

    -Sini

    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Ranks/New Ranks
    « Reply #4 on: May 09, 2015, 08:27:01 PM »
    This really depends on what you mean by saying "Creating a new rank"

    Adding the symbols next to each rank (the crowns) is client sided and you'll have to do some modifications to quite a few methods..
    https://www.rune-server.ee/runescape-development/rs2-client/tutorials/348186-renamed-adding-custom-crowns-detailed-all-chat-types-rewritten-conventi.html
    There's a tutorial on how to do it. If you don't want 14 ranks, then don't use all 14...

    Server sided is much easier. Just assign the person as a new rank.
    So you can just make a command that promotes a player to lets say.. 100.
    The rest would be making sure they don't have access to some staff commands. The reason for this is some servers only add a "greater than" check in the commands or etc..
    Ex:
    Code: Java
    1. if(command.equalsIgnoreCase("xteleto"))&& c.playerRights>1)){
    2. the command here
    3. }
    Well. Clearly 100 is greater than 1, so they can do the command... But who's to say you want them to be able to?

    A good solution to this would be to create methods in the Player class that return booleans. Like. isDonator, isAdmin, isModerator. Etc.
    Then convert your commands from checking the player rights to checking if those booleans are true. And have the booleans check the player right.

    Offlinemalimt

    • Member
    • ****
    • Posts: 472
    • Thanks: +0/-0
      • View Profile
    Re: [PI] Ranks/New Ranks
    « Reply #5 on: May 10, 2015, 01:52:20 AM »
    Thanks guys! Thanks sk8rdude! Worked like a charm.

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal