Thread: [718] Staff Online

Results 1 to 10 of 10
  1. #1 [718] Staff Online 
    Registered Member alkharidrsps's Avatar
    Join Date
    Jun 2014
    Posts
    282
    Thanks given
    9
    Thanks received
    4
    Rep Power
    13
    Anyone got command for 718?
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    May 2014
    Age
    26
    Posts
    256
    Thanks given
    89
    Thanks received
    61
    Rep Power
    12
    Something like this should work I imagine:
    Code:
     case "staffonline":
    		int staffcount = 0;
    		for (Player p : World.getPlayers()) {
    		    if (p.getRights() == 2) {
    			staffcount++;
    		    }
    		}
    		player.getPackets().sendGameMessage("There are currently " + staffcount
    			+ " staff online.");
    		return true;
    Reply With Quote  
     

  3. #3  
    Registered Member alkharidrsps's Avatar
    Join Date
    Jun 2014
    Posts
    282
    Thanks given
    9
    Thanks received
    4
    Rep Power
    13
    Quote Originally Posted by AlexRSPS View Post
    Something like this should work I imagine:
    Code:
     case "staffonline":
    		int staffcount = 0;
    		for (Player p : World.getPlayers()) {
    		    if (p.getRights() == 2) {
    			staffcount++;
    		    }
    		}
    		player.getPackets().sendGameMessage("There are currently " + staffcount
    			+ " staff online.");
    		return true;
    Well, almost. I wanted an interface that shows who were online!
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jan 2015
    Age
    28
    Posts
    210
    Thanks given
    2
    Thanks received
    53
    Rep Power
    2
    Quote Originally Posted by infernal7188 View Post
    Well, almost. I wanted an interface that shows who were online!
    Simple but it will work

    In player.java add this:

    Code:
    public boolean isStaff() {
       return rights == (replace with #) || rights == (replace with #);
    }
    Add this to Commands.java
    Code:
    case "staffonline"://can be named whatever
    			       int number = 0;
    				for(Player p : World.getPlayers()) {
    					if(p == null)
    						continue;
                                           if (!p.isStaff())
                                                    continue;
                                            number++;
    					String title = "";
                                           if (p.getRights() == 1)
                                               title = "Moderator";//etc
                                          player.getPackets().sendIComponentText(275, (16+number), titles + ""+ p.getDisplayName());
    				}
                                    player.getInterfaceManager().sendInterface(275);
                                    player.getPackets().sendIComponentText(275, 2, ""+Settings.SERVER_NAME+" Staff Online");
    				player.getPackets().sendIComponentText(275, 14, "Staff Online");	
    				player.getPackets().sendIComponentText(275, 16, "Staff Online: "+number);
    				for (int i = 16+number+1; i < 316; i++) {
    					player.getPackets().sendHideIComponent(275, i, true);
    				}
                         return true;
    	}
    Attached image
    Reply With Quote  
     

  5. #5  
    Registered Member alkharidrsps's Avatar
    Join Date
    Jun 2014
    Posts
    282
    Thanks given
    9
    Thanks received
    4
    Rep Power
    13
    Quote Originally Posted by TheRealJordon View Post
    Simple but it will work

    In player.java add this:

    Code:
    public boolean isStaff() {
       return rights == (replace with #) || rights == (replace with #);
    }
    Add this to Commands.java
    Code:
    case "staffonline"://can be named whatever
    			       int number = 0;
    				for(Player p : World.getPlayers()) {
    					if(p == null)
    						continue;
                                           if (!p.isStaff())
                                                    continue;
                                            number++;
    					String title = "";
                                           if (p.getRights() == 1)
                                               title = "Moderator";//etc
                                          player.getPackets().sendIComponentText(275, (16+number), titles + ""+ p.getDisplayName());
    				}
                                    player.getInterfaceManager().sendInterface(275);
                                    player.getPackets().sendIComponentText(275, 2, ""+Settings.SERVER_NAME+" Staff Online");
    				player.getPackets().sendIComponentText(275, 14, "Staff Online");	
    				player.getPackets().sendIComponentText(275, 16, "Staff Online: "+number);
    				for (int i = 16+number+1; i < 316; i++) {
    					player.getPackets().sendHideIComponent(275, i, true);
    				}
                         return true;
    	}
    Don't Work
    Reply With Quote  
     

  6. #6  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by infernal7188 View Post
    Don't Work
    Yes it does. What's the error?
    Project thread
    Reply With Quote  
     

  7. #7  
    Registered Member alkharidrsps's Avatar
    Join Date
    Jun 2014
    Posts
    282
    Thanks given
    9
    Thanks received
    4
    Rep Power
    13
    Quote Originally Posted by clem585 View Post
    Yes it does. What's the error?

    Well I do not know say, I just wanted to show this interface supports, adms and online mods for any player able to send a ticket and find out if someone has the staff on.
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Jan 2015
    Age
    28
    Posts
    210
    Thanks given
    2
    Thanks received
    53
    Rep Power
    2
    Quote Originally Posted by infernal7188 View Post
    Well I do not know say, I just wanted to show this interface supports, adms and online mods for any player able to send a ticket and find out if someone has the staff on.
    You have to edit the code around... that's why I said "replace with #". If you can't figure out something this simple you should touch up on Java before moving to RSPS.
    Attached image
    Reply With Quote  
     

  9. #9  
    Registered Member alkharidrsps's Avatar
    Join Date
    Jun 2014
    Posts
    282
    Thanks given
    9
    Thanks received
    4
    Rep Power
    13
    Quote Originally Posted by TheRealJordon View Post
    You have to edit the code around... that's why I said "replace with #". If you can't figure out something this simple you should touch up on Java before moving to RSPS.
    Code:
    public boolean isStaff() {
       return rights == (1) || rights == (2) || rights == (13);
    }
    ??
    1=MOD
    2=ADM
    13=SUPPORT
    Reply With Quote  
     

  10. #10  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by infernal7188 View Post
    Code:
    public boolean isStaff() {
       return rights == (1) || rights == (2) || rights == (13);
    }
    ??
    1=MOD
    2=ADM
    13=SUPPORT
    Yea and do the same as for "Moderator" for admin/support text.
    Project thread
    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. [718] Staff online
    By joshuav1 in forum Requests
    Replies: 3
    Last Post: 05-26-2014, 02:41 PM
  2. 718 server online help
    By arcticpk in forum Help
    Replies: 1
    Last Post: 11-10-2012, 11:26 PM
  3. rsps staff online
    By woody96 in forum Help
    Replies: 6
    Last Post: 07-17-2012, 02:27 AM
  4. Staff Online Isn't Working!
    By Gretar in forum Help
    Replies: 16
    Last Post: 12-13-2011, 12:35 AM
  5. Replies: 15
    Last Post: 07-31-2010, 11:00 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
  •