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

variable help

Comments in 'Plugin Development' started by KirkroCrafter, Jun 15, 2014.

  1. KirkroCrafter
    Offline

    KirkroCrafter Active Member

    Joined:
    Feb 24, 2014
    Posts:
    30
    Minecraft User:
    Kirkro8
    what is the correct variable to include worldname in chat like this

    [WORLDNAME] [PlayerName] : Chat Message

    so i can know what world are there in
  2. unerds
    Offline

    unerds Redditor Plugin Developer

    Joined:
    Aug 28, 2013
    Posts:
    82
    Plugins:
    1
    Minecraft User:
    unerds_
    $variable = $issuer->getLevel()->getName()

    ? something like that.
    64FF00 likes this.
  3. Darunia18
    Offline

    Darunia18 Staff Member Sectional Moderator

    Joined:
    Aug 23, 2013
    Posts:
    755
    Plugins:
    2
    Minecraft User:
    Darunia18
    Moved to Plugin Development. Please people (in general, not you specifically), use the correct section. 3rd time this has happened in the last 2 days.
    64FF00 and PEMapModder like this.
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Where was this before? Help?
    64FF00 and Darunia18 like this.
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Of course this depends on your variable name.
    64FF00 likes this.
  6. KirkroCrafter
    Offline

    KirkroCrafter Active Member

    Joined:
    Feb 24, 2014
    Posts:
    30
    Minecraft User:
    Kirkro8
    $issuer->getLevel()->getName()
    is this correct?
  7. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,201
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    if its chat event or stuff like that, do not use $issuer
    64FF00 likes this.
  8. KirkroCrafter
    Offline

    KirkroCrafter Active Member

    Joined:
    Feb 24, 2014
    Posts:
    30
    Minecraft User:
    Kirkro8
    i used for player chats like
    [WorldName] Kirkro8: [message]
    is it getLevel()->getName() or what??
  9. Dinokiller
    Offline

    Dinokiller Notable Member

    Joined:
    Sep 22, 2013
    Posts:
    376
    Minecraft User:
    Dinokiller_
    On player.chat event use $data["player"]->getLevel()->getName().
    LastHunterKid, 64FF00 and iJoshuaHD like this.
  10. KirkroCrafter
    Offline

    KirkroCrafter Active Member

    Joined:
    Feb 24, 2014
    Posts:
    30
    Minecraft User:
    Kirkro8
    dosent work
    Error:
    Code:
    Parse error: syntax error, unexpected '"', expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\Users\KENT DELACERNA\Desktop\PocketMine-MP_GameServer\plugins\XTi-RankManager-OFFICIAL.php on line 696
    
    This is the Plugin i edited [XTI-RankManager.php]
    PHP:
    $this->api->chat->broadcast("[ $data["player"]->getLevel()->getName() ][" $rank "] " $data["player"]->username " :Says: \n--> " $data["message"]);
    it will be [Factions][OWNER][prefix] Kirkro8: [message]
  11. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,201
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    i suggest you should learn more from basing other's plugin especially that gets player's world location etc ...

    it must be this:

    $this->api->chat->broadcast("[". $data["player"]->getLevel()->getName()."][" . $rank . "] " . $data["player"]->username . " :Says: \n--> " . $data["message"]);


    im not sure about "$data["player"]->getLevel()->getName()" if it is the correct format.
    64FF00 likes this.
  12. Dinokiller
    Offline

    Dinokiller Notable Member

    Joined:
    Sep 22, 2013
    Posts:
    376
    Minecraft User:
    Dinokiller_
    PHP:
    $this->api->chat->broadcast("[" $data["player"]->getLevel()->getName() . "] [" $rank "] " $data["player"]->username " :Says: \n--> " $data["message"]);
    return 
    false// Stops original chat message being sent.
    Use this
    LastHunterKid likes this.
  13. KirkroCrafter
    Offline

    KirkroCrafter Active Member

    Joined:
    Feb 24, 2014
    Posts:
    30
    Minecraft User:
    Kirkro8
    Guys Guys Guys!!!!!
    i tried to chat and this happends: server crashes

    Error Log:

    Attached Files:

  14. MegaSamNinja
    Offline

    MegaSamNinja Active Member

    Joined:
    Sep 13, 2013
    Posts:
    138
    Minecraft User:
    Bamuel
    This chat style looks like Uchat by @IronPony
  15. Dinokiller
    Offline

    Dinokiller Notable Member

    Joined:
    Sep 22, 2013
    Posts:
    376
    Minecraft User:
    Dinokiller_
    Why is the file "XTi-RankManager-OFFICIAL.php"\/
    LastHunterKid and PEMapModder like this.
  16. MegaSamNinja
    Offline

    MegaSamNinja Active Member

    Joined:
    Sep 13, 2013
    Posts:
    138
    Minecraft User:
    Bamuel
    Lol read the chat properly
    Um to fix this error use the up to date XTI rankManager

Share This Page

Advertisement