/// <summary> /// This function is used internally. /// It executes all needed handlers when a specific command occures. /// </summary> /// <param name="str"> /// A <see cref="System.String"/> /// </param> /// <param name="cmd"> /// A <see cref="Command"/> /// </param> internal static void Execute(Player player, Command cmd) { foreach (KeyValuePair<string, ClientCommandDelegate> keyval in events) { if (cmd.ToString().StartsWith(keyval.Key)) { if (keyval.Value != null) { keyval.Value(player, cmd); } } } cmd.Execute(player); }
/// <summary> /// Emulates a player calling a command. /// </summary> /// <param name="p"> /// Instance of the player <see cref="Player"/> /// </param> public void FakeCall(Player p) { overrideArguments = true; instance = this; MetaModEngine.dllapiFunctions.ClientCommand(p.Pointer); instance = null; overrideArguments = false; }
public void SwearCheck(Player player, Command cmd) { }
public CommandEventArgs(Player player, Command command) : base(player) { Command = command; }
void HandleSayExec(Player player, Command command) { // Ommit /exec and execute the following text string exec_string = command.Arguments[1].Split(' ').Shift().Join(' ') + ";"; EvaluateGoldSrc(player, exec_string); }