Thread: !How could i let the player continue fighting if he don't have enough energy for spec

Results 1 to 7 of 7
  1. #1 !How could i let the player continue fighting if he don't have enough energy for spec 
    Registered Member
    Join Date
    Apr 2019
    Posts
    16
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Hello guys ,
    [Only registered and activated users can see links. ]
    this is the code for the user who don't have enough enough energy for special attack , so he stops attack and and send a message for the user that he don't have enough energy..
    How could i send this message , but let em continue attacking , so wins about 3 seconds of wasted waiting time in a real fight .. thanks all
    Reply With Quote  
     

  2. #2  
    Donator

    StanDev's Avatar
    Join Date
    Apr 2014
    Posts
    657
    Thanks given
    70
    Thanks received
    237
    Discord
    StanDev#0990
    Rep Power
    526
    From my understanding, currently when a players tries to do a special attack but does not have enough energy , the player's combat is reset?

    Been a while since I've encountered PI (thank god) but does by any chance the playerIndex variable accessed from c represent the index of the combat target of c?
    If so than commenting out that line might resolve your issue.

    Other than that I don't see any other contenders that could evoke the behaviour you describe in the image provided.
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Apr 2019
    Posts
    16
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by StanDev View Post
    From my understanding, currently when a players tries to do a special attack but does not have enough energy , the player's combat is reset?

    Been a while since I've encountered PI (thank god) but does by any chance the playerIndex variable accessed from c represent the index of the combat target of c?
    If so than commenting out that line might resolve your issue.

    Other than that I don't see any other contenders that could evoke the behaviour you describe in the image provided.
    If i understood u correctly , the playerindex variable is the key for what i want to do..
    But first of all I'm just a beginner , so can u help me and tell me what should i do there?
    Reply With Quote  
     

  4. #4  
    Donator

    StanDev's Avatar
    Join Date
    Apr 2014
    Posts
    657
    Thanks given
    70
    Thanks received
    237
    Discord
    StanDev#0990
    Rep Power
    526
    Quote Originally Posted by abusuhaib View Post
    If i understood u correctly , the playerindex variable is the key for what i want to do..
    But first of all I'm just a beginner , so can u help me and tell me what should i do there?
    Well my general advice for you would be to stop using PI unless you're really settled on the base. There are many more bases that are more noob-friendly and also much more stable than PI (look around the download section for anything that isn't PI.)

    The index (denoted by playerIndex) is an unique number assigned to each player upon login. The server can use this index to lookup the player associated to the index (therefore it is important that the index is unique).

    But let me try to explain what I meant in simpler terms. Basically you have an object 'c' which represents the player requesting a special attack to be performed. From this object you can access values of variables specific to the player represented by the object. This includes the player's life points, combat level etc.. but in your case also the index of (presumably) the player's combat opponent.

    So if the playerIndex accessed from the c object is the index of the player that you targeted in combat. Then setting this to 0 might cause the combat actions of the c object (the player requesting the special attack) to be canceled.

    If all this is super confusing to you then I advice you to first get somewhat familiar with Java (or Object Oriented Programming in general.)
    Last edited by StanDev; 06-20-2019 at 10:20 PM.
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Apr 2019
    Posts
    16
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Hey , I really did what i wanted to do , now the player will continue attacking if he don't have the enough energy for spec
    I solved it with adding two lines..
    [Only registered and activated users can see links. ]
    (before the return line ..)
    Thank you standev for help!

    Edit last 3 lines** (Before the return)
    Reply With Quote  
     

  6. #6  
    Registered Thanker
    MrClassic's Avatar
    Join Date
    Oct 2008
    Age
    24
    Posts
    1,859
    Thanks given
    14,167
    Thanks received
    295
    Rep Power
    5000
    just cancel the clicking on that button if player doesn't have enough special amount
    Thanks, MrClassic.

    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. Thankful user:


  8. #7  
    Registered Member
    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,712
    Thanks given
    170
    Thanks received
    285
    Discord
    Arch337#1337
    Rep Power
    631
    I would do what MrClassic mention, have it cancel the spec and give a message that you do not have enough special attack.
    This means the playerIndex value is not needed.


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

  9. Thankful user:



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. how could i lock the minimap
    By abd1 in forum Help
    Replies: 2
    Last Post: 05-18-2013, 11:01 AM
  2. How could I change the name..
    By Zoft in forum Help
    Replies: 7
    Last Post: 11-03-2010, 09:54 PM
  3. Replies: 1
    Last Post: 05-25-2010, 09:59 PM
  4. Replies: 1
    Last Post: 05-01-2010, 06:32 PM
  5. how do i change the player options
    By mrprostat in forum Help
    Replies: 7
    Last Post: 03-11-2009, 06:57 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
  •