Thread: [317] Adding donator rank [server-sided]

Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1 [317] Adding donator rank [server-sided] 
    Registered Member pkersworld's Avatar
    Join Date
    Mar 2011
    Age
    23
    Posts
    667
    Thanks given
    3
    Thanks received
    21
    Rep Power
    4
    Purpose: Adding donator rank , with working crows!
    req: My client-sided tut: [Only registered and activated users can see links. ]
    Difficulty:2,5/10 (5/10 if you are begginer)
    Assumed Knowledge: Copy And Past
    Classes Modified: client.java and player.java (server-sided)
    Tested On(if it applies): Delta but should work on all. and fubergen client.

    Step 1 - open your client.java and find something like:

    Code:
                        } else if (token.equals("character-assault")) {
                            assaultKills = Integer.parseInt(token2);
    under it add:

    Code:
                        } else if (token.equals("character-donator")) {
                            donator = Integer.parseInt(token2);
    then find something like

    Code:
                      characterfile.write("character-assault = ", 0, 20);
                      characterfile.write(Integer.toString(assaultKills), 0, Integer.toString(assaultKills).length());
                      characterfile.newLine();
    and under that code add:

    Code:
                      characterfile.write("character-donator = ", 0, 20);
                      characterfile.write(Integer.toString(donator), 0, Integer.toString(donator).length());
                      characterfile.newLine();
    now find for something like:

    Code:
                    // mod/admin level crown fix -bakatool
    if (playerRights == 3)
                        out.write(2);
                    else if (playerRights == 2)
                        out.write(2);
                    else if (playerRights == 1)
                        out.write(1);
    and in there add:

    Code:
                    else if(donator == 1 && playerRights == 0)
                        out.write(7);
    now if you want give donator command so add this to your other commands:
    Code:
             if (command.startsWith("gived") && playerName.equalsIgnoreCase("xxxx"))  {
            String name = command.substring(6);
            try {
                int p = PlayerHandler.getPlayerID(name);
                client c = (client) server.playerHandler.players[p];
                c.donator = 1;
                savegame(true);
                c.disconnected = true;
                sM("You just gave"+command.substring(4)+" donator");
                } catch(Exception e) {
                sM(name+" either isn't online or doesn't exist");
                } 
                }
    and change the xxxx to your username

    now close client.java and open player.java

    and add this with your other ints:

    Code:
    public int donator;
    and then find:

    Code:
    protected void appendPlayerChatText(stream str) {
    and replace it with mine:

    Code:
    protected void appendPlayerChatText(stream str) {
            str.writeWordBigEndian(((chatTextColor & 0xFF) << 8)
                    + (chatTextEffects & 0xFF));
            if(donator == 1 && playerRights == 0)str.writeByte(7);
            else if(playerRights == 3) str.writeByte(2);
            else
            str.writeByte(playerRights);
            str.writeByteC(chatTextSize);
            // no more than 256 bytes!!!
            str.writeBytes_reverse(chatText, chatTextSize, 0);
        }
    just save + compile and test!

    Done!!!

    creadits:

    80% for me to codes
    and
    20% for the server base
    -Removed
    Reply With Quote  
     

  2. #2  
    Registered Member pkersworld's Avatar
    Join Date
    Mar 2011
    Age
    23
    Posts
    667
    Thanks given
    3
    Thanks received
    21
    Rep Power
    4
    20 views no posts?

    leeching?
    -Removed
    Reply With Quote  
     

  3. #3  
    Donator

    Jinzy's Avatar
    Join Date
    Aug 2010
    Posts
    533
    Thanks given
    35
    Thanks received
    82
    Rep Power
    87
    helpfull for new people i quess, gj
    Reply With Quote  
     

  4. #4  
    Registered Member pkersworld's Avatar
    Join Date
    Mar 2011
    Age
    23
    Posts
    667
    Thanks given
    3
    Thanks received
    21
    Rep Power
    4
    Quote Originally Posted by farmer4life View Post
    helpfull for new people i quess, gj

    yes , thx for posting
    -Removed
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    May 2009
    Posts
    845
    Thanks given
    44
    Thanks received
    39
    Rep Power
    29
    Has been released, and is in most PI's originally anyways,
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Dec 2010
    Posts
    198
    Thanks given
    35
    Thanks received
    16
    Rep Power
    0
    Quote Originally Posted by i0wn3v3ry View Post
    Has been released, and is in most PI's originally anyways,
    Not everyone uses PI. It's overused, and becoming ridiculous. This is easily converted.
    Plus this is Delta.
    OT: Man not bad.
    Reply With Quote  
     

  7. #7  
    Registered Member pkersworld's Avatar
    Join Date
    Mar 2011
    Age
    23
    Posts
    667
    Thanks given
    3
    Thanks received
    21
    Rep Power
    4
    Quote Originally Posted by i0wn3v3ry View Post
    Has been released, and is in most PI's originally anyways,
    ty for posting , but there is many servers that dont have it!

    Quote Originally Posted by pingpong View Post
    Not everyone uses PI. It's overused, and becoming ridiculous. This is easily converted.
    Plus this is Delta.
    OT: Man not bad.
    thanks for posting
    -Removed
    Reply With Quote  
     

  8. #8  
    Registered Member Sirius's Avatar
    Join Date
    Mar 2011
    Posts
    269
    Thanks given
    18
    Thanks received
    14
    Rep Power
    7
    Thanks, I might play around with this, pretty nifty
    Reply With Quote  
     

  9. #9  
    Registered Member pkersworld's Avatar
    Join Date
    Mar 2011
    Age
    23
    Posts
    667
    Thanks given
    3
    Thanks received
    21
    Rep Power
    4
    Quote Originally Posted by Zalestro View Post
    Thanks, I might play around with this, pretty nifty

    np and ty for posting
    -Removed
    Reply With Quote  
     

  10. #10  
    Registered Member Mikey's Avatar
    Join Date
    Apr 2011
    Posts
    751
    Thanks given
    570
    Thanks received
    32
    Rep Power
    40
    Can you explain the codes?
    Like explain this to me and what does the out.write(7) part mean...?

    Code:
     
    else if(donator == 1 && playerRights == 0)
                        out.write(7);
    Also would there be a way to give a different crown to donator == 2?

    - Mikey
    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: 8
    Last Post: 01-12-2014, 11:17 PM
  2. [PI] Need help adding donator rank
    By Debugger in forum Help
    Replies: 15
    Last Post: 09-07-2010, 12:39 AM
  3. [PI] Need help adding donator rank
    By Debugger in forum Help
    Replies: 3
    Last Post: 09-04-2010, 11:02 PM
  4. Help adding donator icon & rank
    By demoniclife in forum Help
    Replies: 1
    Last Post: 10-29-2009, 04:46 AM
  5. Replies: 29
    Last Post: 10-11-2009, 03:36 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
  •