Solved Checking if player is being spectated?
Discussion in 'Rust Development' started by Austinv900, Sep 6, 2016.
-
Maybe it's possible to check with OnServerCommand and see if the entered name can be found?
-
Wulf Community Admin
You'd have to check for a child object I believe to see if a player is attached to them.
-
looking by code, the spectating player is added to the spectated object as parent:
and he has then this two Flags:Code:base.SetParent(baseEntity, 0u);
Code:IsDeadIsSpectating
-
But no real way to check for parents?
-
Wulf Community Admin
Well, if you want to check if a player has someone spectating them, you'd check for their children. If you want to check if someone is spectating someone, you can either check IsSpectating (or something like that) if set, else check for their parent like suggested previously. -
Ok Ill see if I can find that
-
Thanks @Wulf I never thought of doing children. I was trying to use Parent. lol
