Plutonium-T6-Scripts/chat_commands/zm/chat_command_no_target.gsc
2023-10-15 22:05:57 +02:00

45 lines
755 B
Plaintext

#include scripts\chat_commands;
Init()
{
CreateCommand(level.chat_commands["ports"], "notarget", "function", ::NoTargetCommand, 3, array("default_help_one_player"), array("ignoreme", "ignore"));
}
/* Command section */
NoTargetCommand(args)
{
if (args.size < 1)
{
return NotEnoughArgsError(1);
}
error = ToggleNoTarget(args[0]);
if (IsDefined(error))
{
return error;
}
}
/* Logic section */
ToggleNoTarget(playerName)
{
player = FindPlayerByName(playerName);
if (!IsDefined(player))
{
return PlayerDoesNotExistError(playerName);
}
commandName = "notarget";
ToggleStatus(commandName, "No Target", player);
player.ignoreme = GetStatus(commandName, player);
}