mirror of
https://github.com/Resxt/Plutonium-IW5-Scripts.git
synced 2025-04-19 20:52:54 +00:00
chat_commands 1.1.7
Added invisible command to grant or remove the invisible state to a player (toggle) Note that this does not make you invisible to bots in the sense that even if they can't see you they will still know your position and shoot you on sight
This commit is contained in:
parent
7766d9ecb9
commit
6bf08da690
@ -40,6 +40,7 @@ InitCommands()
|
|||||||
CreateCommand(level.commands_servers_ports, "changeteam", "function", ::ChangeTeamCommand, "default_help_one_player");
|
CreateCommand(level.commands_servers_ports, "changeteam", "function", ::ChangeTeamCommand, "default_help_one_player");
|
||||||
CreateCommand(level.commands_servers_ports, "teleport", "function", ::TeleportCommand, "default_help_two_players");
|
CreateCommand(level.commands_servers_ports, "teleport", "function", ::TeleportCommand, "default_help_two_players");
|
||||||
CreateCommand(level.commands_servers_ports, "norecoil", "function", ::NoRecoilCommand, "default_help_one_player");
|
CreateCommand(level.commands_servers_ports, "norecoil", "function", ::NoRecoilCommand, "default_help_one_player");
|
||||||
|
CreateCommand(level.commands_servers_ports, "invisible", "function", ::InvisibleCommand, "default_help_one_player");
|
||||||
|
|
||||||
// Specific server(s) text commands
|
// Specific server(s) text commands
|
||||||
CreateCommand(["27016", "27017"], "rules", "text", ["Do not camp", "Do not spawnkill", "Do not disrespect other players"]);
|
CreateCommand(["27016", "27017"], "rules", "text", ["Do not camp", "Do not spawnkill", "Do not disrespect other players"]);
|
||||||
@ -296,6 +297,21 @@ NoRecoilCommand(args)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InvisibleCommand(args)
|
||||||
|
{
|
||||||
|
if (args.size < 1)
|
||||||
|
{
|
||||||
|
return NotEnoughArgsError(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
error = ToggleInvisible(args[0]);
|
||||||
|
|
||||||
|
if (IsDefined(error))
|
||||||
|
{
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Logic functions section */
|
/* Logic functions section */
|
||||||
@ -378,6 +394,29 @@ ToggleNoRecoil(playerName)
|
|||||||
ToggleStatus("no_recoil", "No Recoil", player);
|
ToggleStatus("no_recoil", "No Recoil", player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Error functions section */
|
/* Error functions section */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user