This forum is going to be locked at the end of this year and eventually going offline. If you have feedback to share you can find us in our Discord channel "MythoLogic Interactive" https://discord.gg/nECKnbT7gk

Make sure to read the rules.

How do I detect 1 Player not all of them?

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Post Reply
TaiHuiDo
Meatbag
Posts: 2
Joined: Fri Jul 14, 2017 9:56 pm
Gender:

How do I detect 1 Player not all of them?

Post by TaiHuiDo » Fri Jul 14, 2017 9:58 pm

I need help with detecting 1 player not like Game.GetPlayers(); I need to understand how UniquieID works. Please help fast.
0 x

jamisco
Superfighter
Superfighter
Posts: 67
Joined: Sun Nov 06, 2016 11:34 pm
Title: Da God
SFD Account: Jamisco
SFD Alias: Jamisco
Started SFD: either late 2015 or early 2016
Location: Somewhere in the east of the United states
Gender:
Age: 104

Post by jamisco » Mon Jul 17, 2017 5:50 pm

so each player in the game has a unique ID,for example say they are 6 players in the game, player 1 can will have U-ID 1, player 2 will have U-ID 2 and so on... when you call Game.GetPlayer(Unique-ID), you simply use the player's Id to in sense detect the player.... if you want to get the player's Id, you can do this

Code: Select all

            int[] plyr_ID = new int[] { };
            int i = 0;
            foreach (IPlayer plyr in Game.GetPlayers())
            {
                plyr_ID[i] = plyr.UniqueID;
                i++;
            }
additionally, if you are in map editor, you can simply hover over the spawn player icon to get the unique ID ... its called ID not unique ID in map editor
as shown in this picture
1 x
Is it better to be feared or respected... please, is it too much to ask for both?

TaiHuiDo
Meatbag
Posts: 2
Joined: Fri Jul 14, 2017 9:56 pm
Gender:

Post by TaiHuiDo » Mon Jul 17, 2017 9:22 pm

LOVE U MAN!
0 x

Post Reply