mirror of
https://github.com/Resxt/Plutonium-IW5-Scripts.git
synced 2025-04-19 20:52:54 +00:00
chat_command_invisible 1.0.0
This commit is contained in:
parent
1a4c6a3cee
commit
18938c2487
@ -31,6 +31,16 @@ The player affected by the command dies and swaps to the other team.
|
|||||||
Arguments expected: the complete name of a player.
|
Arguments expected: the complete name of a player.
|
||||||
Example: `!changteam Resxt`
|
Example: `!changteam Resxt`
|
||||||
|
|
||||||
|
## chat_command_invisible.gsc
|
||||||
|
|
||||||
|
Toggles invisibility on the targeted player.
|
||||||
|
Note that this does not make the player invisible to bots in the sense that even if they can't see the player, they will still know his position and shoot him.
|
||||||
|
|
||||||
|
| Examples |
|
||||||
|
|---|
|
||||||
|
| `!invisible me` |
|
||||||
|
| `!invisible Resxt` |
|
||||||
|
|
||||||
## chat_command_map_mode.gsc
|
## chat_command_map_mode.gsc
|
||||||
|
|
||||||
3 related commands in one file:
|
3 related commands in one file:
|
||||||
|
52
chat_commands/chat_command_invisible.gsc
Normal file
52
chat_commands/chat_command_invisible.gsc
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
#include scripts\chat_commands;
|
||||||
|
|
||||||
|
Init()
|
||||||
|
{
|
||||||
|
CreateCommand(level.commands_servers_ports, "invisible", "function", ::InvisibleCommand, ["default_help_one_player"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Command section */
|
||||||
|
|
||||||
|
InvisibleCommand(args)
|
||||||
|
{
|
||||||
|
if (args.size < 1)
|
||||||
|
{
|
||||||
|
return NotEnoughArgsError(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
error = ToggleInvisible(args[0]);
|
||||||
|
|
||||||
|
if (IsDefined(error))
|
||||||
|
{
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Logic section */
|
||||||
|
|
||||||
|
ToggleInvisible(playerName)
|
||||||
|
{
|
||||||
|
player = FindPlayerByName(playerName);
|
||||||
|
|
||||||
|
if (!IsDefined(player))
|
||||||
|
{
|
||||||
|
return PlayerDoesNotExistError(playerName);
|
||||||
|
}
|
||||||
|
|
||||||
|
commandName = "invisible";
|
||||||
|
|
||||||
|
ToggleStatus(commandName, "Invisible", player);
|
||||||
|
|
||||||
|
if (GetStatus(commandName, player))
|
||||||
|
{
|
||||||
|
player hide();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player show();
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user