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

Speed

Discussion in 'Development' started by Jonas, Apr 12, 2017.

  1. Jonas

    Jonas Baby Zombie

    Messages:
    192
    How can i make an anti speed? And Check if he has Speed
     
    Last edited: Apr 12, 2017
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    try slowness effect?
     
  3. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Yes but how can i check if a player has Speed
     
  4. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    $player->hasEffect(Effect::SPEED) will return a bool result for whether or not the player has the effect.
     
  5. Jonas

    Jonas Baby Zombie

    Messages:
    192
    I think you dont unterstand me. My Question is how can i check if a player has a Speed hack
     
  6. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
  7. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Can give me an example for: Check Distance / time
     
    Last edited: Apr 12, 2017
  8. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    it would be better for you tr try on your own with the given links first
     
  9. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Ok i'll try this
     
    Last edited: Apr 12, 2017
  10. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Please stop using Google Translate to translate thw whole website, it bugs arount totally, just paste the words you don't understand on translate.google.com...
     
    Sandertv likes this.
  11. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    There is lot of ways how to check player speed. One of them is checking move distance.
    Example:
    PHP:
    public function onMove(PlayerMoveEvent $e){
    $p =$e->getPlayer();
    $a $e->getFrom();
    $b $e->getTo();
    $speed $a->distance($b);
    This check distance. But to make you sure if player is using speed hack check time between getting from current position to new position
    }[/PHP]
     
  12. Jonas

    Jonas Baby Zombie

    Messages:
    192
    How can i check the time?
     
  13. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    $time = microtime(true);
     
    Kyd likes this.
  14. Jonas

    Jonas Baby Zombie

    Messages:
    192
    In Ticks or Seconds?
     
  15. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    Last edited: Apr 13, 2017
  16. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Ok thanks i hope thats right.
    PHP:
    if($distance && $time 5.6) {
                 
    $player->kick("Speed is not allowed");
            }
     
  17. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
  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.