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

how can i make diffrent variable to players

Discussion in 'Off-Topic' started by GilBenDavid, May 23, 2017.

  1. GilBenDavid

    GilBenDavid Silverfish

    Messages:
    20
    i mean
    the same variable for exemple will be
    for player1 $variable = 1
    for player2 $variable = 2
     
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    using arrays seems the best way to do that
    also wrong section
     
    corytortoise and GilBenDavid like this.
  3. GilBenDavid

    GilBenDavid Silverfish

    Messages:
    20

    thanks for your fast answer !
    i try this example and its send the same variable to diffrent players (when just 1 player use args)
    if you can send work exemple I will thank you very much !!! .

    (sorry for my english...o_O)

    PHP:
                         case "welcome":
                                              
    $level$this->getServer()->getLevelByName("world");
                                              if(isset(
    $args[0])){
                         
    $this->welcome[$array[$sender->getName()]] = new Position($args[0],$args[1],$args[2],$level);
                                              }else{
                                              
    $this->getServer()->BroadCastMessage("".$this->welcome[$array[$sender->getName()]]."");
                                              }
             break;
     
  4. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    You're referring to class properties, not variables, right?
     
  5. 0x15f

    0x15f Baby Zombie

    Messages:
    145
    GitHub:
    0x15f
    What exactly is this code supposed to achieve? There isn't enough of it for support to be provided, post the whole class and more help could be provided.
     
  6. GilBenDavid

    GilBenDavid Silverfish

    Messages:
    20
    this code is example for diffrent variable i didnt want to achive from this code anything (just example)
    anyway i tracked the problem the "$array" variable unnecessary
     
  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.