mirror of
https://github.com/Resxt/Plutonium-T6-Scripts.git
synced 2025-10-08 07:36:39 +00:00
chat_command_invisible 1.0.0
This commit is contained in:
54
chat_commands/chat_command_invisible.gsc
Normal file
54
chat_commands/chat_command_invisible.gsc
Normal file
@@ -0,0 +1,54 @@
|
||||
#include scripts\chat_commands;
|
||||
|
||||
Init()
|
||||
{
|
||||
CreateCommand(level.chat_commands["ports"], "invisible", "function", ::InvisibleCommand, 3, array("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();
|
||||
player.ignoreme = 1; // zombies won't target the player
|
||||
}
|
||||
else
|
||||
{
|
||||
player Show();
|
||||
player.ignoreme = 0; // zombies will target the player again
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user