How can I use HoldingPlayerInGrabID, if it is not even the same as UserID or UserIdentifier. What I want to do, is to get IPlayer object, that other player is holding and I can't figure out how. To me HoldingPlayerInGrabID, CaughtByPlayerInGrabID etc. seem to be some random numbers, that I can't use.
Please, help me out with this.
Here is screenshot of some dubugging
Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.
New to the forum? Say hello in this topic! Also make sure to read the rules.
New to the forum? Say hello in this topic! Also make sure to read the rules.
Issue with HoldingPlayerInGrabID
Forum rules
By using the forum you agree to the following rules.
By using the forum you agree to the following rules.
- Gurt
- Lead Programmer
- Posts: 1884
- Joined: Sun Feb 28, 2016 3:22 pm
- Title: Lead programmer
- Started SFD: Made it!
- Location: Sweden
- Gender:
- Age: 34
HoldingPlayerInGrabID refers to the player ID - not the User ID. IUser is not to be confused with IPlayer.
Use Game.GetPlayer(IPlayer.HoldingPlayerInGrabID) to get the player instance.
Bots spawned in a map for example have no IUser bound to them.
IPlayer.HoldingPlayerInGrabID refers to the IPlayer.UniqueID which is inherited from IObject.
(Note: IUser.UserID is the same as IUser.UserIdentifier)
Use Game.GetPlayer(IPlayer.HoldingPlayerInGrabID) to get the player instance.
Bots spawned in a map for example have no IUser bound to them.
Code: Select all
IPlayer grabbedPlayer = Game.GetPlayer(IPlayer.HoldingPlayerInGrabID);
if (grabbedPlayer != null) {
// grabbedPlayer.UniqueID
}
(Note: IUser.UserID is the same as IUser.UserIdentifier)
0 x
Gurt
-
- Meatbag
- Posts: 2
- Joined: Wed Jul 24, 2019 11:46 pm
- SFD Account: Qunas
- Started SFD: PreAlpha 1.4.0 or so
- Location: Ukraine
- Gender:
- Age: 22
Thank you! I shoud've searched better for this in documentetion.
And now I see how IDs can be used with Game.GetPlayer() or Game.GetActiveUser()
Thx with that.
Yea, I see that
And now I see how IDs can be used with Game.GetPlayer() or Game.GetActiveUser()
Thx with that.
0 x