Thread: [PI] Admin commands and playercommands

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 [PI] Admin commands and playercommands 
    looking for partnership

    Satan's Avatar
    Join Date
    Oct 2010
    Posts
    833
    Thanks given
    287
    Thanks received
    68
    Rep Power
    269
    Alright community!

    This is the problem i got, when i add my vote command (to claim the reward ) in regularcommands it does not work for anyone, but if i delete if from regularcommand and add it into admincommands it works "only for admins thougt"

    The cmd prints no error.

    Thank you!

    Regularcommands: http://pastebin.com/gPyzysUS

    Admincommands: http://pastebin.com/3fiJxqXN

    [/url]
    Reply With Quote  
     

  2. #2  
    Registered Member ARshadow's Avatar
    Join Date
    Aug 2011
    Posts
    470
    Thanks given
    30
    Thanks received
    41
    Rep Power
    53
    post the code please
    Spoiler for Vouches:
    Quote Originally Posted by Liam Baby
    Vouch
    Quote Originally Posted by Mojo!
    vouch for adding killstreak system to my server
    Quote Originally Posted by jet kai
    Vouch for buying 28m of me, very fast, no hassle and trusted.
    All these vouches are on my profile, I just put it into quotes and in my signature to make it easier for users to find .
    Reply With Quote  
     

  3. #3  
    looking for partnership

    Satan's Avatar
    Join Date
    Oct 2010
    Posts
    833
    Thanks given
    287
    Thanks received
    68
    Rep Power
    269
    Thread updated ^.^

    [/url]
    Reply With Quote  
     

  4. #4  
    Registered Member ARshadow's Avatar
    Join Date
    Aug 2011
    Posts
    470
    Thanks given
    30
    Thanks received
    41
    Rep Power
    53
    Doubt these might work but you should try:

    1st:

    Try putting your claim and auth commands directly underneath this line:

    Code:
     public static void handleRegularCommands(Client c, String playerCommand) {
    If that don't work, try adding a playerright check? Like

    Code:
    c.playerRights == 7
    Spoiler for Vouches:
    Quote Originally Posted by Liam Baby
    Vouch
    Quote Originally Posted by Mojo!
    vouch for adding killstreak system to my server
    Quote Originally Posted by jet kai
    Vouch for buying 28m of me, very fast, no hassle and trusted.
    All these vouches are on my profile, I just put it into quotes and in my signature to make it easier for users to find .
    Reply With Quote  
     

  5. #5  
    looking for partnership

    Satan's Avatar
    Join Date
    Oct 2010
    Posts
    833
    Thanks given
    287
    Thanks received
    68
    Rep Power
    269
    Quote Originally Posted by ARshadow View Post
    Doubt these might work but you should try:

    1st:

    Try putting your claim and auth commands directly underneath this line:

    Code:
     public static void handleRegularCommands(Client c, String playerCommand) {
    If that don't work, try adding a playerright check? Like

    Code:
    c.playerRights == 7
    Dosent work

    [/url]
    Reply With Quote  
     

  6. #6  
    Registered Member ARshadow's Avatar
    Join Date
    Aug 2011
    Posts
    470
    Thanks given
    30
    Thanks received
    41
    Rep Power
    53
    Hmm. Do you still have a commands.java or have you just divided it into different classes based on playerrights?
    Spoiler for Vouches:
    Quote Originally Posted by Liam Baby
    Vouch
    Quote Originally Posted by Mojo!
    vouch for adding killstreak system to my server
    Quote Originally Posted by jet kai
    Vouch for buying 28m of me, very fast, no hassle and trusted.
    All these vouches are on my profile, I just put it into quotes and in my signature to make it easier for users to find .
    Reply With Quote  
     

  7. #7  
    looking for partnership

    Satan's Avatar
    Join Date
    Oct 2010
    Posts
    833
    Thanks given
    287
    Thanks received
    68
    Rep Power
    269
    Quote Originally Posted by ARshadow View Post
    Hmm. Do you still have a commands.java or have you just divided it into different classes based on playerrights?
    Code:
    package server.model.players.packets;
    
    import java.sql.ResultSet;
    
    import server.Config;
    import server.Connection;
    import server.Server;
    import server.model.npcs.NPCHandler;
    import server.model.players.Client;
    import server.model.players.PacketType;
    import server.model.players.Player;
    import server.model.players.PlayerHandler;
    import server.model.players.PlayerSave;
    import server.world.ClanHandler;
    import server.world.ShopHandler;
    import server.model.players.Teleport;
    import server.model.players.commands.*;
    
    /**
     * Commands
     **/
    public class Commands implements PacketType {
    
    
    
    	@Override
    	public void processPacket(Client c, int packetType, int packetSize) {
    		String playerCommand = c.getInStream().readString();
    		RegularCommands.handleRegularCommands(c, playerCommand);
    		ModeratorCommands.handleModeratorCommands(c, playerCommand);
    		AdminCommands.handleAdminCommands(c, playerCommand);
    		OwnerCommands.handleOwnerCommands(c, playerCommand);
    		//DeveloperCommands.handleDeveloperCommands(c, playerCommand);
        }
    }

    [/url]
    Reply With Quote  
     

  8. #8  
    Donator
    Mr Extremez's Avatar
    Join Date
    Jun 2012
    Posts
    2,243
    Thanks given
    97
    Thanks received
    298
    Rep Power
    61
    Quote Originally Posted by Johan View Post
    Code:
    package server.model.players.packets;
    
    import java.sql.ResultSet;
    
    import server.Config;
    import server.Connection;
    import server.Server;
    import server.model.npcs.NPCHandler;
    import server.model.players.Client;
    import server.model.players.PacketType;
    import server.model.players.Player;
    import server.model.players.PlayerHandler;
    import server.model.players.PlayerSave;
    import server.world.ClanHandler;
    import server.world.ShopHandler;
    import server.model.players.Teleport;
    import server.model.players.commands.*;
    
    /**
     * Commands
     **/
    public class Commands implements PacketType {
    
    
    
    	@Override
    	public void processPacket(Client c, int packetType, int packetSize) {
    		String playerCommand = c.getInStream().readString();
    		RegularCommands.handleRegularCommands(c, playerCommand);
    		ModeratorCommands.handleModeratorCommands(c, playerCommand);
    		AdminCommands.handleAdminCommands(c, playerCommand);
    		OwnerCommands.handleOwnerCommands(c, playerCommand);
    		//DeveloperCommands.handleDeveloperCommands(c, playerCommand);
        }
    }
    What's the point of seperate classes, the old commands class is fine.
    Add my new Skype: live:extremezgp

    Discord: Mr Extremez#3049

    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Sep 2007
    Posts
    41
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    try adding, not sure if it will help but just a thought haha

    Code:
                    if(c.playerRights <= 0) {
                            return;
                    }
    EDIT: Actually does it do it with all regular commands or just the vote one?

    EDIT2: after looking at the commands in regualr you need to add else if to the vote commands. so like this

    Code:
    else if (playerCommand.startsWith("reward") || playerCommand.startsWith("claim")) {
    Code:
    else if (playerCommand.startsWith("auth") && playerCommand.length() > 5) {
    Code:
    else if(playerCommand.startsWith("vote")) {
    Reply With Quote  
     

  10. #10  
    Middle Finger is Here


    Join Date
    Feb 2012
    Age
    31
    Posts
    2,546
    Thanks given
    377
    Thanks received
    502
    Rep Power
    162
    if (playerCommandStartsWith("Vote") && c.playerRights == 0) {

    something like that :X
    Hi
    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. [Dementhium] Playercommands
    By Kristjan in forum Help
    Replies: 5
    Last Post: 11-12-2011, 09:09 AM
  2. [pi]admin+ commands for normal player
    By Tired in forum Help
    Replies: 7
    Last Post: 07-19-2011, 12:31 AM
  3. Paradox 2.0 Admin commands?
    By Avatarpain in forum Help
    Replies: 1
    Last Post: 12-21-2009, 08:34 PM
  4. Making admin commands
    By Fale in forum Help
    Replies: 1
    Last Post: 04-13-2009, 12:15 PM
  5. Making Admin Only commands
    By `Lubricant in forum Tutorials
    Replies: 13
    Last Post: 08-23-2008, 11:47 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
  •