mirror of
https://github.com/Resxt/Plutonium-IW5-Scripts.git
synced 2025-04-19 20:52:54 +00:00
chat_command_freeze 1.0.0
This commit is contained in:
parent
108b06962a
commit
760db1a2eb
@ -31,6 +31,17 @@ 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_freeze.gsc
|
||||||
|
|
||||||
|
Toggles whether the targeted player can move or not.
|
||||||
|
Note that this does not work during the prematch period.
|
||||||
|
Also, if you unfreeze a bot the bot has to die before he starts moving again.
|
||||||
|
|
||||||
|
| Examples |
|
||||||
|
|---|
|
||||||
|
| `!freeze me` |
|
||||||
|
| `!freeze Resxt` |
|
||||||
|
|
||||||
## chat_command_invisible.gsc
|
## chat_command_invisible.gsc
|
||||||
|
|
||||||
Toggles invisibility on the targeted player.
|
Toggles invisibility on the targeted player.
|
||||||
|
79
chat_commands/chat_command_freeze.gsc
Normal file
79
chat_commands/chat_command_freeze.gsc
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
#include scripts\chat_commands;
|
||||||
|
|
||||||
|
Init()
|
||||||
|
{
|
||||||
|
CreateCommand(level.commands_servers_ports, "freeze", "function", ::FreezeCommand, ["default_help_one_player"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Command section */
|
||||||
|
|
||||||
|
FreezeCommand(args)
|
||||||
|
{
|
||||||
|
if (args.size < 1)
|
||||||
|
{
|
||||||
|
return NotEnoughArgsError(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
error = ToggleFreeze(args[0]);
|
||||||
|
|
||||||
|
if (IsDefined(error))
|
||||||
|
{
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Logic section */
|
||||||
|
|
||||||
|
ToggleFreeze(playerName)
|
||||||
|
{
|
||||||
|
player = FindPlayerByName(playerName);
|
||||||
|
|
||||||
|
if (!IsDefined(player))
|
||||||
|
{
|
||||||
|
return PlayerDoesNotExistError(playerName);
|
||||||
|
}
|
||||||
|
|
||||||
|
commandName = "freeze";
|
||||||
|
|
||||||
|
ToggleStatus(commandName, "Freeze", player);
|
||||||
|
|
||||||
|
if (GetStatus(commandName, player))
|
||||||
|
{
|
||||||
|
player DoFreeze(true);
|
||||||
|
player thread ThreadFreeze();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DoFreeze(false);
|
||||||
|
player notify("chat_commands_freeze_off");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ThreadFreeze()
|
||||||
|
{
|
||||||
|
self endon("disconnect");
|
||||||
|
self endon("chat_commands_freeze_off");
|
||||||
|
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
self waittill("spawned_player");
|
||||||
|
|
||||||
|
DoFreeze(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DoFreeze(enabled)
|
||||||
|
{
|
||||||
|
if (enabled)
|
||||||
|
{
|
||||||
|
self freezecontrols(1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self freezecontrols(0);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user