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

ui spam

Discussion in 'Development' started by Angel, Aug 12, 2019.

  1. Angel

    Angel Spider Jockey

    Messages:
    44
    GitHub:
    aimjel
    So, I send a UI on PlayerInteractEvent and when I try to esc from the ui or click on one of the button's I just get the same form again. Any help?
     
  2. Gianluxx

    Gianluxx Slime

    Messages:
    94
    GitHub:
    Gianluxx
    playerinteractevent is called 4 times (multiple times) when right clicking on w10. Put the player in an array and if already in the array, dont send him the form. when he replies to the form, remove the player from the array
     
    HimbeersaftLP likes this.
  3. Angel

    Angel Spider Jockey

    Messages:
    44
    GitHub:
    aimjel
    any other work arounds? can I just cancel a certain packet?
     
  4. Fadhel

    Fadhel Witch

    Messages:
    68
    GitHub:
    dimbis
    PHP:
    private $players = [];
    private 
    $wait 2;
    public function 
    onInteract(PlayerInteractEvent $event){
    $player $event->getPlayer();
    $item $event->getItem();
    if(
    $item->getCustomName === "foo"){
    $name $player->getName();
    if(!isset(
    $this->players[$name]) or time() > $this->players[$name]){
    $this->players[$name] = time() + $this->wait;
    //TODO
    }else{
    $event->setCancelled();
     
  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.