NwPluginAPI icon indicating copy to clipboard operation
NwPluginAPI copied to clipboard

Add player scale

Open SrLicht opened this issue 2 years ago • 3 comments

  • Added NetworkIdentity in Player.cs
  • Added Scale in Player.cs
    • It is now possible to change the size of a player from NWAPI.
  • Added SpawnMessage method in Server.cs

Credits

This method was taken from https://github.com/Axwabo/AdminTools-NWAPI/blob/master/AdminTools/EventHandlers.cs#L154 which in is a fork of Exiled RemoteAdmin

SrLicht avatar Jul 17 '23 11:07 SrLicht

I think I should go to sleep: imagen

SrLicht avatar Jul 17 '23 11:07 SrLicht

    Add them
    public static bool PlayerScaleIs(this Player target, Vector3 scale) => target.GameObject.transform.localScale == scale;

    public static bool PlayerScaleIs(this Player target, float scale) => PlayerScaleIs(target, Vector3.one * scale);

XLittleLeft avatar Jul 28 '23 13:07 XLittleLeft

    Add them
    public static bool PlayerScaleIs(this Player target, Vector3 scale) => target.GameObject.transform.localScale == scale;

    public static bool PlayerScaleIs(this Player target, float scale) => PlayerScaleIs(target, Vector3.one * scale);

Unnecessary, you can already do it without an extension

if(ev.Player.Scale == new Vector3(1, 1, 1))
{
  // your code here
}

SrLicht avatar Jul 28 '23 14:07 SrLicht