northwood-studios / NwPluginAPI

Official server-side plugin system for SCP: Secret Laboratory game.
GNU Lesser General Public License v3.0
81 stars 46 forks source link

Add player scale #216

Open SrLicht opened 1 year ago

SrLicht commented 1 year ago

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 commented 1 year ago

I think I should go to sleep: imagen

XLittleLeft commented 1 year ago
    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);
SrLicht commented 1 year ago
    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
}