Is there a way to get data for the other players ? menu

Shout-Out

User Tag List

Results 1 to 6 of 6
  1. #1
    User5981's Avatar First Dev On The Internet
    Reputation
    379
    Join Date
    Aug 2017
    Posts
    765
    Thanks G/R
    30/358
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there a way to get data for the other players ?

    Hi guys,

    I can get my player data from Hud.Game.Me but how can I get the data from other players in the party ?

    Using foreach (var player in players) or is there another way ? (like getting data for player 3 only)

    Thanks.

    Is there a way to get data for the other players ?
  2. #2
    JackCeparou's Avatar Savvy ? 🐒
    Reputation
    534
    Join Date
    Mar 2017
    Posts
    588
    Thanks G/R
    51/490
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    using System.Linq;

    // inside your method :
                
    var playerByIndex Hud.Game.Players.FirstOrDefault(=> p.Index == 2);
                
    // or
                // var playerByPortraitIndex = Hud.Game.Players.FirstOrDefault(p => p.PortraitIndex == 2);
                // don't forget to test for null
                
    if (playerByIndex != null)
                {
                    
    //do your stuff
                

    Hide the Rum! --> Default theme customization 101 <--

  3. Thanks User5981 (1 members gave Thanks to JackCeparou for this useful post)
  4. #3
    User5981's Avatar First Dev On The Internet
    Reputation
    379
    Join Date
    Aug 2017
    Posts
    765
    Thanks G/R
    30/358
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by JackCeparou View Post
    PHP Code:
    using System.Linq;

    // inside your method :
                
    var playerByIndex Hud.Game.Players.FirstOrDefault(=> p.Index == 2);
                
    // or
                // var playerByPortraitIndex = Hud.Game.Players.FirstOrDefault(p => p.PortraitIndex == 2);
                // don't forget to test for null
                
    if (playerByIndex != null)
                {
                    
    //do your stuff
                

    I tried to use it but playerByIndex is always null

  5. #4
    JackCeparou's Avatar Savvy ? 🐒
    Reputation
    534
    Join Date
    Mar 2017
    Posts
    588
    Thanks G/R
    51/490
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try to use portraitIndex instead.
    Hide the Rum! --> Default theme customization 101 <--

  6. #5
    User5981's Avatar First Dev On The Internet
    Reputation
    379
    Join Date
    Aug 2017
    Posts
    765
    Thanks G/R
    30/358
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by JackCeparou View Post
    Try to use portraitIndex instead.
    it's working, I was just doing it at the wrong place,
    + I solved a two weeks long dilemma just by using a public variable :shh:
    STUPID ME IS LEARNING THE HARD WAY...

    [v7.3] [INTERNATIONAL] [Resu] ParagonPercentagePlugin

  7. #6
    KillerJohn's Avatar TurboHUD HUDmaster CoreCoins Purchaser Authenticator enabled
    Reputation
    3696
    Join Date
    Jul 2012
    Posts
    2,532
    Thanks G/R
    46/3338
    Trade Feedback
    0 (0%)
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by JackCeparou View Post
    PHP Code:
    using System.Linq;

    // inside your method :
                
    var playerByIndex Hud.Game.Players.FirstOrDefault(=> p.Index == 2);
                
    // or
                // var playerByPortraitIndex = Hud.Game.Players.FirstOrDefault(p => p.PortraitIndex == 2);
                // don't forget to test for null
                
    if (playerByIndex != null)
                {
                    
    //do your stuff
                

    index is the slot index in the game (there are 4 slots)
    if you create a game then you are #0
    then somebody joins, he is #1
    then you leave, he is still #1, while #0 is empty
    then somebody join instead of you, he is #0
    then you rejoin, you are #3
    and so on

    portraitIndex is ordered by the portraits on the screen, so you are always #0
    Do not send me private messages unless it is absolutely necessary or the content is sensitive or when I ask you to do that...

Similar Threads

  1. Is there any way to get to kezan/lost isles?
    By silbot in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 08-22-2012, 05:26 AM
  2. Is there an way to get this at PlayStation 3
    By serialkillerz in forum Community Chat
    Replies: 0
    Last Post: 05-29-2010, 07:02 AM
  3. Is there a way to get old nax back
    By Presto12 in forum WoW EMU Questions & Requests
    Replies: 8
    Last Post: 07-11-2009, 02:13 AM
  4. Is there any way to get ranks?
    By shadow5677 in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 08-15-2008, 03:13 PM
  5. Is there a way to get players to start with gold?
    By Wow Raiders in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 03-22-2008, 02:15 PM
All times are GMT -5. The time now is 11:39 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search