I am trying to make a plugin that lets players use the growableentity.growall command, here is the method that the command uses
[ServerVar(ServerAdmin = true)]
public static void GrowAll(ConsoleSystem.Arg arg)
{
BasePlayer basePlayer = arg.Player();
if (!basePlayer.IsAdmin)
return;
List<GrowableEntity> list = Facepunch.Pool.GetList<GrowableEntity>();
Vis.Entities<GrowableEntity>(basePlayer.ServerPosition, 6f, list, -1, QueryTriggerInteraction.Collide);
foreach (GrowableEntity growableEntity in list)
{
if (growableEntity.isServer)
growableEntity.ChangeState(growableEntity.currentStage.nextState, false, false);
}
Facepunch.Pool.FreeList<GrowableEntity>(ref list);
}
I've tried removing the is player admin checks and putting a ChatCommand above it but I've had no luck, how would I change this to a chat command that non admins can use?
I've tried removing the is player admin checks and putting a ChatCommand above it but I've had no luck, how would I change this to a chat command that non admins can use?