chat_command_wallhack 1.0.0

This commit is contained in:
Resxt 2023-02-16 04:18:06 +01:00
parent 18938c2487
commit 108b06962a
2 changed files with 88 additions and 0 deletions

View File

@ -89,6 +89,15 @@ Prints the server rules in the player's chat.
Arguments expected: none.
Example: `!rules`
## chat_command_wallhack.gsc
Toggles wallhack (red boxes) on the targeted player
| Examples |
|---|
| `!wallhack me` |
| `!wallhack Resxt` |
## chat_commands.gsc
The core script that holds the configuration, runs all the chat logic and holds utils function that are shared between all the `chat_command` scripts.

View File

@ -0,0 +1,79 @@
#include scripts\chat_commands;
Init()
{
CreateCommand(level.commands_servers_ports, "wallhack", "function", ::WallhackCommand, ["default_help_one_player"]);
}
/* Command section */
WallhackCommand(args)
{
if (args.size < 1)
{
return NotEnoughArgsError(1);
}
error = ToggleWallhack(args[0]);
if (IsDefined(error))
{
return error;
}
}
/* Logic section */
ToggleWallhack(playerName)
{
player = FindPlayerByName(playerName);
if (!IsDefined(player))
{
return PlayerDoesNotExistError(playerName);
}
commandName = "wallhack";
ToggleStatus(commandName, "Wallhack", player);
if (GetStatus(commandName, player))
{
player DoWallhack(true);
player thread ThreadWallhack();
}
else
{
player DoWallhack(false);
player notify("chat_commands_wallhack_off");
}
}
ThreadWallhack()
{
self endon("disconnect");
self endon("chat_commands_wallhack_off");
for(;;)
{
self waittill("spawned_player");
DoWallhack(true);
}
}
DoWallhack(enabled)
{
if (enabled)
{
self ThermalVisionFOFOverlayOn();
}
else
{
self ThermalVisionFOFOverlayOff();
}
}