Thread: [PI] Adding Crowns And Player rights

Page 1 of 3 123 LastLast
Results 1 to 10 of 25
  1. #1 [PI] Adding Crowns And Player rights 
    Banned

    Join Date
    Jul 2011
    Age
    28
    Posts
    1,740
    Thanks given
    101
    Thanks received
    81
    Rep Power
    0
    [PI] Adding Crowns And Player rights.


    Difficulty 5/10

    Lets Start with

    Client Sided Find

    client.java


    First in client.java search for

    Code:
    modicon
    cr0
    and pushmessage
    okay so when you found modicon (each case is a new player right) you change it to the new modicon you added so lets say you added

    Code:
    case 7:
    modeicon[7].drawSprite(xPos, yPos - 12);
    xPos += 14;
    break;
    it mean that modicon7 is going to be cr7 is what number the image is in your sprites folder and case 7 means player rights 7.

    now for:

    Code:
    pushmessage
    push message is what shows the crown when you talk for whisper clan talk and regular an example would be this:
    Code:
    if(myPrivilege == 7) {
    pushMessage(myPlayer.textSpoken, 2, "@[email protected]" + myPlayer.name);
    This is the part that shows your icon in game and where abouts so search for cr0 and replace each one with what we have above ^

    double check you changed all the pushmessage by searching for
    Code:
    cr0

    now find your sprites and find where your modicons picture is make a new crown it label is MODICONS 7 all caps. This is the crown icon that you put above (cr7).


    now for server sided go to commands youll see something like this

    Code:
        if (c.playerRights >= 0)
            playerCommands(c, playerCommand);
        if (c.playerRights == 5 || c.playerRights == 6 || c.playerRights == 3) 
            moderatorCommands(c, playerCommand);
        if (c.playerRights == 6 || c.playerRights == 3) 
            administratorCommands(c, playerCommand);
        if (c.playerRights == 3) 
            ownerCommands(c, playerCommand);
            DonatorCommands(c, playerCommand);
            if (c.playerRights == 4) 
            DonatorCommands(c, playerCommand);
                if (c.playerRights == 5) 
            moderatorCommands(c, playerCommand);
        }
    add your player rights to whichever sort of Rights you want to give them than add a command that is sort like this

    Code:
                            if (playerCommand.startsWith("giveadmin")) {
                                    try {        
                                            String playerToAdmin = playerCommand.substring(10);
                                            for(int i = 0; i < Config.MAX_PLAYERS; i++) {
                                                    if(Server.playerHandler.players[i] != null) {
                                                            if(Server.playerHandler.players[i].playerName.equalsIgnoreCase(playerToAdmin)) {
                                                                    Client c2 = (Client)Server.playerHandler.players[i];
                                                                    c2.sendMessage("You have been given admin status by " + c.playerName);
                                                                    c2.playerRights = 7;
                                                                    c2.logout();
                                                                    break;
                                                            } 
                                                    }
                                            }
    change the send message and c2.playerrights and command.starts with with whatever you like
    for me number 7 is the admin so i made the command name giveadmin
    and to give the right player rights your working with this


    Code:
    c2.playerRights = 7
    that is how you add a new crown attached to different player rights. when I have more time I will update this.
    Reply With Quote  
     

  2. #2  
    Acid Paradox'

    Kidd's Avatar
    Join Date
    Jul 2011
    Posts
    501
    Thanks given
    20
    Thanks received
    41
    Rep Power
    119
    Nice Tutorial it will help alot of people out.
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Jul 2011
    Age
    28
    Posts
    1,740
    Thanks given
    101
    Thanks received
    81
    Rep Power
    0
    Thanks man.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jul 2011
    Posts
    72
    Thanks given
    0
    Thanks received
    10
    Rep Power
    8
    I cant get it to work in the server side...
    I keep getting this error after i add Support to my commands..

    src\server\model\players\packets\commands.java:56: cannon find symbol
    symbol : method SupportCommands(server.model.players.Client,java.l ang.string)
    location: class server.model.players.packets.Commands
    SupportCommands(c, playerCommand);
    ^
    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Jul 2011
    Age
    28
    Posts
    1,740
    Thanks given
    101
    Thanks received
    81
    Rep Power
    0
    What base you using? also you dont have it in your commands.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Addiction's Avatar
    Join Date
    Mar 2011
    Posts
    959
    Thanks given
    1,875
    Thanks received
    136
    Rep Power
    311
    Will help a lot of people, nice job man
    Reply With Quote  
     

  7. #7  
    Registered Member


    Join Date
    Sep 2010
    Posts
    1,213
    Thanks given
    87
    Thanks received
    159
    Rep Power
    726
    Goodjob.
    "“La vida es un suspiro, basta verla diferente para que ya sea mejor”
    -Canserbero


    圣地亚哥

    "You can't buy class, class comes by itself"
    -Zlatan Ibrahimović
    Reply With Quote  
     

  8. #8  
    Member Market Banned Market Banned
    Kota Ko's Avatar
    Join Date
    Aug 2009
    Age
    23
    Posts
    1,032
    Thanks given
    26
    Thanks received
    59
    Rep Power
    19
    Goodjob even though not explained right at all...
    Reply With Quote  
     

  9. #9  
    Banned

    Join Date
    Jul 2011
    Age
    28
    Posts
    1,740
    Thanks given
    101
    Thanks received
    81
    Rep Power
    0
    sorry going to work on it now as I never had much time.
    Reply With Quote  
     

  10. #10  
    Banned
    Join Date
    Aug 2011
    Posts
    117
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Can you make how to add donator symbol with the variable:
    isDonator = 1/2/3
    Reply With Quote  
     

Page 1 of 3 123 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. [PI] Adding more player rights [PI]
    By Mythic in forum Help
    Replies: 10
    Last Post: 07-19-2011, 12:01 AM
  2. Replies: 4
    Last Post: 05-16-2011, 03:55 PM
  3. Replies: 8
    Last Post: 05-30-2010, 10:52 AM
  4. Replies: 0
    Last Post: 09-10-2009, 07:19 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
  •