public void Execute(Rocket.Unturned.Player.RocketPlayer caller, string[] command) { DateTime currenttime = DateTime.Now; DateTime delaytime; //ushort id2 = ushort.Parse(command[0]); // TODO how does this differ from GetUInt16Parameter() ? ushort? id = RocketCommandExtensions.GetUInt16Parameter(command, 0); int? count = RocketCommandExtensions.GetInt32Parameter(command, 1); float? delay = RocketCommandExtensions.GetFloatParameter(command, 2); // if ((command.Length < 3 && caller == null) || (command.Length < 3 && caller.HasPermission("advancedeffect"))) if (command.Length < 3 && (caller.HasPermission("advancedeffect") || caller == null || caller.IsAdmin)) { RocketChat.Say(caller, "missing parameters! command usage: <id> <amount of times> <delay between effects>"); } else if (command.Length == 3 && (caller == null || caller.IsAdmin || caller.HasPermission("advancedeffect"))) { for (int ii = 1; ii <= count.Value; ii++) { delaytime = currenttime.AddMilliseconds(delay.Value); bool doloop = true; while (doloop) { continuelooping: currenttime = DateTime.Now; if (currenttime >= delaytime) { // caller.TriggerEffect(id.Value); Logger.Log("the time comparison worked!"); doloop = false; } else { goto continuelooping; } } } } else { if (caller == null) { Logger.Log("u dont have permission to use this command!"); } else { RocketChat.Say(caller, "u dont have permission to use this command!"); } } }