Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Sign foreach Player?

Comments in 'Plugin Development' started by JackboyPlay, Jul 17, 2016.

  1. JackboyPlay
    Offline

    JackboyPlay Active Member

    Joined:
    Apr 25, 2015
    Posts:
    507
    Minecraft User:
    JackboyPlay
    Hi, how can I do it that foreach player is a sign like Player 1 see on the sign Welcome Player1 and Player 2 see on the sign Welcome Player 2?
  2. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Please more description
  3. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    You have to send each player packets
    applqpak likes this.
  4. udwarf
    Offline

    udwarf Active Member

    Joined:
    Apr 17, 2016
    Posts:
    61
    Minecraft User:
    1Zaza
    JackboyPlay not sure if it is possible without deep digging into the pocketmine's core
    Easest way is to send personal message to the player by $player->sendMessage
  5. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    Lol you use
    PHP:
    for($i 0;$i <= 1000;$i++){
                                 if(
    $i === 1000){
                                 
    $player->sendMessage("welcome Ritch you are the 1000 to click on a sign !");
                                  return;
                                 }
                                  
    $example $i+1;
                                  
    Ect..... 
  6. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
  7. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    No, it's not hard at all also it's possible without hacking into...
    applqpak likes this.
  8. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    Survingo and applqpak like this.
  9. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    It really depends on what you define as hacking. To some people, sending data packets is already hacking, since it might be backwards-inompatible.
    applqpak likes this.
  10. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    *incompatible
  11. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    You got the point and if others didn't this isn't right place for them.
  12. udwarf
    Offline

    udwarf Active Member

    Joined:
    Apr 17, 2016
    Posts:
    61
    Minecraft User:
    1Zaza
    Can you please show code example?
    As I see, in the mentioned killrate plugin, for cusomising sign text is used PlayerInteract Event .
    So user have to interact with the sign to get personal text. But how to implement that without asking user to touch a sign?
  13. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    How about scheduling a PluginTask after all levels have been loaded
  14. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Don't do nothing you don't know how it works. If you don't understand how you do this, or how the code by @aliuly works, then don't use it. If you understand it, you can see that you can just use this anywhere you want, not only in PlayerInteractEvent.
    Last edited: Jul 21, 2016
    SOFe likes this.
  15. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    It is code by @aliuly not @PEMapModder!
    Survingo and CraftYourBukkit like this.
  16. udwarf
    Offline

    udwarf Active Member

    Joined:
    Apr 17, 2016
    Posts:
    61
    Minecraft User:
    1Zaza
    The only place where i think it could be properly used is PlayerMoveEvent. If the player close enough to the sign, than send to the player text-update packet.
    Well, it could be a solution!
  17. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    You should not use PlayerMoveEvent. That would lag a lot.
    A PluginTask is better for that

Share This Page

Advertisement