mirror of
https://github.com/Resxt/Plutonium-T6-Scripts.git
synced 2025-04-19 13:42:54 +00:00
chat_command_god_mode 1.0.0
This commit is contained in:
parent
ceab91035f
commit
6d3a7b41ed
@ -70,6 +70,23 @@ set cc_permission_4 ""
|
||||
- If you prefer to display information (error messages, status change etc.) in the player's chat rather than on his screen you can do that on a dedicated server. For this you need to install [t6-gsc-utils.dll](https://github.com/fedddddd/t6-gsc-utils#installation) (dedicated server only) and change `self IPrintLnBold(message);` to `self tell(message);` in the `TellPlayer` function
|
||||
- Support for clantags was added. You can use the player names in-game or in the dvars without having to care about their clantag. The [setClantag function](https://github.com/fedddddd/t6-gsc-utils#chat) replaces the player name so additional work was required to make the script ignore the clantag
|
||||
|
||||
## chat_command_god_mode.gsc
|
||||
|
||||
Toggles whether the targeted player is in god mode (invincible) or not.
|
||||
|
||||
| # | Argument | Mandatory |
|
||||
|---|---|---|
|
||||
| 1 | The name of the player to toggle god mode for | :white_check_mark: |
|
||||
|
||||
| Examples |
|
||||
|---|
|
||||
| `!god me` |
|
||||
| `!god Resxt` |
|
||||
|
||||
| Permission level |
|
||||
|---|
|
||||
| 3 |
|
||||
|
||||
## chat_command_teleport.gsc
|
||||
|
||||
Teleports a player to the position of another player.
|
||||
|
79
chat_commands/chat_command_god_mode.gsc
Normal file
79
chat_commands/chat_command_god_mode.gsc
Normal file
@ -0,0 +1,79 @@
|
||||
#include scripts\chat_commands;
|
||||
|
||||
Init()
|
||||
{
|
||||
CreateCommand(level.chat_commands["ports"], "god", "function", ::GodModeCommand, 3, array("default_help_one_player"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Command section */
|
||||
|
||||
GodModeCommand(args)
|
||||
{
|
||||
if (args.size < 1)
|
||||
{
|
||||
return NotEnoughArgsError(1);
|
||||
}
|
||||
|
||||
error = ToggleGodMode(args[0]);
|
||||
|
||||
if (IsDefined(error))
|
||||
{
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Logic section */
|
||||
|
||||
ToggleGodMode(playerName)
|
||||
{
|
||||
player = FindPlayerByName(playerName);
|
||||
|
||||
if (!IsDefined(player))
|
||||
{
|
||||
return PlayerDoesNotExistError(playerName);
|
||||
}
|
||||
|
||||
commandName = "god";
|
||||
|
||||
ToggleStatus(commandName, "God Mode", player);
|
||||
|
||||
if (GetStatus(commandName, player))
|
||||
{
|
||||
player DoGodMode(true);
|
||||
player thread ThreadGodMode();
|
||||
}
|
||||
else
|
||||
{
|
||||
player DoGodMode(false);
|
||||
player notify("chat_commands_god_mode_off");
|
||||
}
|
||||
}
|
||||
|
||||
ThreadGodMode()
|
||||
{
|
||||
self endon("disconnect");
|
||||
self endon("chat_commands_god_mode_off");
|
||||
|
||||
for(;;)
|
||||
{
|
||||
self waittill("spawned_player");
|
||||
|
||||
self DoGodMode(true);
|
||||
}
|
||||
}
|
||||
|
||||
DoGodMode(enabled)
|
||||
{
|
||||
if (enabled)
|
||||
{
|
||||
self EnableInvulnerability();
|
||||
}
|
||||
else
|
||||
{
|
||||
self disableInvulnerability();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user