Thread: Help with playerrights [317]

Results 1 to 6 of 6
  1. #1 Help with playerrights [317] 
    Registered Member
    Join Date
    Aug 2013
    Posts
    74
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Ok so i added a god command, how do I set the player rights on it to be 3? and can you also tell me why it goes there for future commands

    Current code:

    Code:
    		if (playerCommand.equalsIgnoreCase("god")) {
    	
    						c.getPA().requestUpdates();
    							c.playerLevel[3] = 99999;
    							c.getPA().refreshSkill(3);
    							c.gfx0(754);
    							c.sendMessage("You are now a god.");
    }
    Reply With Quote  
     

  2. #2  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Could do
    Code:
    		if (playerCommand.equalsIgnoreCase("god")) {
    	if(c.playerRights != 3) { return; }
    						c.getPA().requestUpdates();
    							c.playerLevel[3] = 99999;
    							c.getPA().refreshSkill(3);
    							c.gfx0(754);
    							c.sendMessage("You are now a god.");
    }
    or
    Code:
    		if (playerCommand.equalsIgnoreCase("god") && c.playerRights == 3) {
    						c.getPA().requestUpdates();
    							c.playerLevel[3] = 99999;
    							c.getPA().refreshSkill(3);
    							c.gfx0(754);
    							c.sendMessage("You are now a god.");
    }


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Aug 2013
    Posts
    74
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    ok thank you very much, but i have 1 more question, now that only owners can use it.

    How can i add a line that would make it so if i use ("God") again it will bring me back to 99 hp?
    Reply With Quote  
     

  4. #4  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by Kjloveday View Post
    ok thank you very much, but i have 1 more question, now that only owners can use it.

    How can i add a line that would make it so if i use ("God") again it will bring me back to 99 hp?
    Ah if I told you that, you would just ask for more xD. Try something yourself for once.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Feb 2014
    Posts
    51
    Thanks given
    0
    Thanks received
    1
    Rep Power
    11
    Hint: Add a check if hp is above 150 or so and if it is set it to 99. Sloppy way of doing it, but it would work.
    Reply With Quote  
     

  6. #6  
    Boy Wonder


    Join Date
    Mar 2012
    Posts
    849
    Thanks given
    139
    Thanks received
    80
    Rep Power
    99
    Quote Originally Posted by Kjloveday View Post
    ok thank you very much, but i have 1 more question, now that only owners can use it.

    How can i add a line that would make it so if i use ("God") again it will bring me back to 99 hp?
    you can do this with an if statement to do a check but using a ternary statement is much easier.
    Java ternary examples - the Java ternary operator | conditional operator | alvinalexander.com
    Code:
    c.playerLevel[3] = c.playerLevel[3] <= 99 ? 99999 : 99;

    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. Help with my 317 server.
    By BrodsBruin in forum Help
    Replies: 0
    Last Post: 05-28-2013, 07:31 PM
  2. Need help with soulsplit 317
    By Dion in forum Help
    Replies: 1
    Last Post: 03-01-2011, 02:11 PM
  3. Help with my 317 Graphics!
    By tommy1234 in forum Help
    Replies: 1
    Last Post: 11-10-2010, 12:52 AM
  4. need help with adding 317 home
    By Jesse in forum Help
    Replies: 2
    Last Post: 09-07-2009, 04:47 AM
  5. Need help with ancients [317].
    By rangepkw in forum Help
    Replies: 0
    Last Post: 02-01-2009, 05:43 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
  •