Thread: How to disable potions when dieing?

Results 1 to 9 of 9
  1. #1 How to disable potions when dieing? 
    Extreme Donator

    Join Date
    Jul 2011
    Posts
    546
    Thanks given
    31
    Thanks received
    18
    Rep Power
    39
    When a player is smited and has 0 prayer points he or she can just drink a pray pot and turn on protect from item when dieing? I tried to just go into potions.java and put

    Code:
    		if (c.isDead = true) {
    					c.sendMessage("You cant do that while dieing.");
    					return;
    				}
    Alls that did was make it when i drank any potion I died

    Any ideas how I can make them unable to drink as they are dieing?
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Dec 2011
    Posts
    454
    Thanks given
    17
    Thanks received
    37
    Rep Power
    61
    Code:
    		if (c.isDead == true) {
    					c.sendMessage("You cant do that while dieing.");
    					return;
    				}
    You were making yourself dead, to use a check you need 2 equal signs. If that doesn't work, you could try adding something like if(hp > 0) where clicking potions is being handled.
    Reply With Quote  
     

  3. #3  
    Extreme Donator

    Join Date
    Jul 2011
    Posts
    546
    Thanks given
    31
    Thanks received
    18
    Rep Power
    39
    I realise exactly what i did wrong lol. But it didnt work Any other ideas?
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Dec 2011
    Posts
    454
    Thanks given
    17
    Thanks received
    37
    Rep Power
    61
    Quote Originally Posted by Gershon View Post
    Code:
    		if (c.isDead == true) {
    					c.sendMessage("You cant do that while dieing.");
    					return;
    				}
    You were making yourself dead, to use a check you need 2 equal signs. If that doesn't work, you could try adding something like if(hp > 0) where clicking potions is being handled.
    Or instead of HP checking, you can also do death checking.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Karma_K's Avatar
    Join Date
    Nov 2012
    Posts
    4,283
    Thanks given
    152
    Thanks received
    610
    Rep Power
    108
    Add the check to clickitem.java where potions are being called
    Reply With Quote  
     

  6. #6  
    Extreme Donator

    Join Date
    Jul 2011
    Posts
    546
    Thanks given
    31
    Thanks received
    18
    Rep Power
    39
    Quote Originally Posted by Karma_K View Post
    Add the check to clickitem.java where potions are being called
    That didnt work either any other ideas?
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Dec 2011
    Posts
    454
    Thanks given
    17
    Thanks received
    37
    Rep Power
    61
    Quote Originally Posted by rar349 View Post
    That didnt work either any other ideas?
    Can you post the code you are using for checking?
    Reply With Quote  
     

  8. #8  
    Extreme Donator

    Join Date
    Jul 2011
    Posts
    546
    Thanks given
    31
    Thanks received
    18
    Rep Power
    39
    Quote Originally Posted by Gershon View Post
    Can you post the code you are using for checking?
    The same as what you posted above
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Dec 2011
    Posts
    454
    Thanks given
    17
    Thanks received
    37
    Rep Power
    61
    Quote Originally Posted by rar349 View Post
    The same as what you posted above
    Did you try to check their HP instead of if their dead?
    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] how to add text when someone dies.
    By mathun in forum Help
    Replies: 6
    Last Post: 12-14-2012, 03:56 AM
  2. Replies: 1
    Last Post: 12-27-2011, 03:54 AM
  3. How to add skillxp when u first log in [Tut]
    By Mojave in forum Tutorials
    Replies: 3
    Last Post: 12-14-2008, 07:50 PM
  4. How To Disable User Account Control In Vista
    By Vegeta in forum Software
    Replies: 1
    Last Post: 06-23-2008, 10:16 PM
  5. Replies: 22
    Last Post: 05-29-2007, 04:14 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
  •