1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved How to resetfallDistance?

Discussion in 'Development' started by LewBr, Nov 4, 2017.

  1. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    I have tested to reset fall distance of a player whit $player->resetfallDistance();
    but now on the new PMMP api don't work, how can i do that now in new version ALPHA-9..?
    If this functions doesn't exists anymore, please help me whit sending another code, but i just want that the player goes to the floor.
     
    MasterPE likes this.
  2. Irish

    Irish Baby Zombie

    Messages:
    156
    GitHub:
    irishpacks
    How are you trying to use it? Because it works internally in PMMP.
     
  3. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    It seems to be working fine, but maybe it wasn't up to your expectations. Are you trying to make the player fall after disabling flight for the player? The function's name might be sorta misleading.
     
  4. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    That's my code:
    PHP:
      if($args[0] == "off") {
            
    $sender->setAllowFlight(false);

            
    $sender->sendMessage("...");
            
    $sender->resetFallDistance();

            return 
    true;
     
    MasterPE likes this.
  5. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    It has another way to do that? I have already maked this whit a teleport, but i don't remember how anymore.
     
    MasterPE likes this.
  6. Irish

    Irish Baby Zombie

    Messages:
    156
    GitHub:
    irishpacks
    The function resetFallDistance just sets their fall distance to 0, which means if they are high in the air and do the command, it'll kill them as their fall distance will continue to increment.
     
  7. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    Like, if i do that it doesn't do anything i just keep flying and don't teleport me to the ground.
     
    MasterPE likes this.
  8. Irish

    Irish Baby Zombie

    Messages:
    156
    GitHub:
    irishpacks
    Perhaps this is what you're looking for?
     
    MasterPE and LewBr like this.
  9. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    Amazing, thank you.
     
    MasterPE likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.