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

Multiple IDs in statement

Discussion in 'Facepalm' started by Lorak9904, Jun 4, 2017.

  1. Lorak9904

    Lorak9904 Witch

    Messages:
    58
    Hey, im just wondering how to add many IDs of items (in players hand) in statement...
    PHP:
    if($player->getItemInHand()->getId() == 257){
    When player holds one of (for example) 5 items, something happens...
     
    Last edited: Jun 4, 2017
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    you can use OR statements
     
  3. Lorak9904

    Lorak9904 Witch

    Messages:
    58
    Finally some answer... I've beed using that, but it didnt work... I could have done some mistakes... Can you please write how should it look like? For example of IDs like 278, 279, 297...
     
  4. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    if ($id == 278 OR $id==279 OR $id = 280){
    you are recommended to check out php.net about these basic things...
     
  5. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
  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.