Thread: [Pi] ::ResetTask Command Help

Results 1 to 6 of 6
  1. #1 [Pi] ::ResetTask Command Help 
    Registered Member Skarlett's Avatar
    Join Date
    Apr 2013
    Posts
    405
    Thanks given
    47
    Thanks received
    7
    Rep Power
    13
    Hello --

    So currently I have a ::ResetTask Command that resets your current slayer task.

    I made it so that, when you Reset your task you lose 25 slayer points. However, if you reset your task with less than 25 points it goes into the negatives, and if you reset it again it won't go any farther negative.

    I need the command to send a message such as "You don't have enough Slayer Points to do that" if you have less than 25 points. This is what I currently have, I have been playing around a lot with it:

    Code:
    if (playerCommand.startsWith("resettask")) {
    			if (c.SPoints == 0);
    			c.sendMessage ("You do not have any Slayer Points to do that!");
    			} else {
    			if (c.SPoints == 25);
    			c.sendMessage("Your Slayer Task has been Reset. Talk to Kuradel for a new one!");
    				c.SPoints = -25;
    				c.sendMessage("Resetting your task cost you 25 Slayer Points!");
    				c.taskAmount = -1;
    				c.slayerTask = 0;
    			}
    ♡Lovvveeee♡
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jul 2012
    Posts
    900
    Thanks given
    66
    Thanks received
    85
    Rep Power
    0
    Code:
    if (playerCommand.startsWith("resettask")) {
    			if (c.SPoints < 25){
    			c.sendMessage ("You do not have any Slayer Points to do that!");
    			} else {
    c.sendMessage("Your Slayer Task has been Reset. Talk to Kuradel for a new one!");
    				c.SPoints = -25;
    				c.sendMessage("Resetting your task cost you 25 Slayer Points!");
    				c.taskAmount = -1;
    				c.slayerTask = 0;
    			}
    }
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member Skarlett's Avatar
    Join Date
    Apr 2013
    Posts
    405
    Thanks given
    47
    Thanks received
    7
    Rep Power
    13
    Quote Originally Posted by Raverz View Post
    Code:
    if (playerCommand.startsWith("resettask")) {
    			if (c.SPoints < 25){
    			c.sendMessage ("You do not have any Slayer Points to do that!");
    			} else {
    c.sendMessage("Your Slayer Task has been Reset. Talk to Kuradel for a new one!");
    				c.SPoints = -25;
    				c.sendMessage("Resetting your task cost you 25 Slayer Points!");
    				c.taskAmount = -1;
    				c.slayerTask = 0;
    			}
    }
    Code:
    if (c.SPoints < 25){
    That's all I had to do? Sheesh I was so close

    Thank you for this!
    ♡Lovvveeee♡
    Reply With Quote  
     

  5. #4  
    Registered Member

    Join Date
    May 2012
    Age
    28
    Posts
    1,548
    Thanks given
    415
    Thanks received
    231
    Rep Power
    81
    c.SPoints -= 25;

    What you have is setting it to negative 25.
    Inactive.


    Spoiler for FirstDesign:
    Reply With Quote  
     

  6. Thankful user:


  7. #5  
    Registered Member Skarlett's Avatar
    Join Date
    Apr 2013
    Posts
    405
    Thanks given
    47
    Thanks received
    7
    Rep Power
    13
    Quote Originally Posted by Solstice View Post
    c.SPoints -= 25;

    What you have is setting it to negative 25.
    Ah, yes. Thank you for this.
    ♡Lovvveeee♡
    Reply With Quote  
     

  8. #6  
    Registered Member
    Join Date
    Jul 2012
    Posts
    900
    Thanks given
    66
    Thanks received
    85
    Rep Power
    0
    Didnt even see that xD
    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. [PI] Lottery Command Help! [PI]
    By x dh x in forum Help
    Replies: 3
    Last Post: 03-09-2012, 06:05 PM
  2. Replies: 13
    Last Post: 06-04-2011, 07:38 PM
  3. PI setlevel command help REP
    By Syndicate in forum Help
    Replies: 1
    Last Post: 02-06-2011, 03:24 PM
  4. [PI] Yell Command Help [Please]
    By GasMask in forum Help
    Replies: 9
    Last Post: 01-08-2011, 02:03 PM
  5. [PI]Little Command Help[PI]
    By Joshua F in forum Help
    Replies: 4
    Last Post: 07-21-2010, 04:07 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
  •