chat_command_no_target 1.0.0

This commit is contained in:
Resxt 2023-10-15 22:05:57 +02:00
parent 525d50dfc0
commit d8ffda994a
2 changed files with 62 additions and 0 deletions

View File

@ -2,6 +2,23 @@
These scripts go in `scripts\zm`
## chat_command_no_target.gsc
Toggles whether the targeted player is in no target mode (invisible to zombies) or not.
| # | Argument | Mandatory |
|---|---|---|
| 1 | The name of the player to toggle no target for | :white_check_mark: |
| Examples |
|---|
| `!notarget me` |
| `!notarget Resxt` |
| Permission level |
|---|
| 3 |
## chat_command_points.gsc
4 related commands in one file:

View File

@ -0,0 +1,45 @@
#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);
}