item_held prefilters

Discussion in 'CommandHelper' started by Oboist, Apr 8, 2018.

  1. Oboist

    Oboist Member

    Hello!

    How can I use item_bind for certain player?
    In that case:
    PHP:
    /bind = >>>
    @pl = player()
    bind(item_held, array(id: step[email protected]pl), array(player: @pl), @event){
         console(@event[player])
    }
    <<<
    after I use /bind i will see in console names of all players that are switching their slots, not just mine.
  2. PseudoKnight

    PseudoKnight Well-Known Member Developer

    There is no item_held prefilter. You can check for the player in the script inside the bind.

    Example:
    PHP:
    bind(item_held, null, null, @event, @player = player()) {
      if(@player == player()) {
        # do stuff
     }
    }
  3. Oboist

    Oboist Member

    Thank you!
    ...how I lived without [@custom_params...] before? Defintely will use import() less often now =)
  4. PseudoKnight

    PseudoKnight Well-Known Member Developer

    item_held would be a good candidate for a player prefilter, though, so I may add it.