Thread: Little bit of help

Results 1 to 5 of 5
  1. #1 Little bit of help 
    Donator

    Anthony's Avatar
    Join Date
    Dec 2007
    Age
    29
    Posts
    1,344
    Thanks given
    198
    Thanks received
    129
    Rep Power
    355
    I want to make this

    Code:
    if (playerCommand.equalsIgnoreCase("staff")) {
    int totalAmountOfStaff = 0;
    for (Player p : PlayerHandler.players) {
    if (p != null && p.playerRights > 0 && p.playerRights != 4)
    totalAmountOfStaff++;
    }
    c.sendMessage("Total staff online: " + totalAmountOfStaff);
    }
    work on my quest tab so basically I want it to be like this

    Staff Online : X (x= amount of staff)

    But it I want it to appear on my quest tab.. anyway?
    Reply With Quote  
     

  2. #2  
    Donator

    Thock321's Avatar
    Join Date
    Jul 2011
    Posts
    1,804
    Thanks given
    706
    Thanks received
    363
    Rep Power
    416
    declare this variable
    Code:
    private int staffOn
    add this method
    Code:
    public void getStaffOn() {
    for (Player p : PlayerHandler.players) {
    if (p != null && playerRights > 0 && playerRights != 4)
    staffOn++;
    }
    }
    add this to process (or somewhere else you want)
    Code:
    getStaffOn();
    getPA().sendFrame126("Staff Online: "+staffOn+" ", 29167);
    Not 100% sure this works. Haven't tested.
    Reply With Quote  
     

  3. #3  
    Donator

    Anthony's Avatar
    Join Date
    Dec 2007
    Age
    29
    Posts
    1,344
    Thanks given
    198
    Thanks received
    129
    Rep Power
    355
    Hmm something is wrong for sure... Whenever there is at lease one staff member it just counts ..

    1
    2
    3
    4
    ect...
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Dec 2011
    Posts
    63
    Thanks given
    2
    Thanks received
    3
    Rep Power
    11
    Don't know much about this at all, but do the ++ have anything to do with it.

    Code:
    public void getStaffOn() {
    for (Player p : PlayerHandler.players) {
    if (p != null && playerRights > 0 && playerRights != 4)
    staffOn++;
    }
    }
    I really don't know, just throwing an idea.
    Reply With Quote  
     

  5. #5  
    Donator

    Anthony's Avatar
    Join Date
    Dec 2007
    Age
    29
    Posts
    1,344
    Thanks given
    198
    Thanks received
    129
    Rep Power
    355
    no it should be ++ ... i just don't know why it's doubling itself.
    Reply With Quote  
     


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. 32 Bit run.bat work with 64 Bit run.bat
    By iHybrid in forum Help
    Replies: 2
    Last Post: 09-14-2011, 06:24 AM
  2. Project PK tearing PI apart bit by bit!!
    By I Shaolin I in forum Projects
    Replies: 14
    Last Post: 01-04-2011, 10:10 PM
  3. Need a bit of help, [PI]
    By HaVoK0321 in forum Help
    Replies: 2
    Last Post: 10-17-2010, 10:46 PM
  4. 8-bit, 16-bit, 32-bit, bytes
    By Mikey` in forum Application Development
    Replies: 8
    Last Post: 06-01-2010, 01:11 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
  •