mirror of
https://github.com/Resxt/Plutonium-T6-Scripts.git
synced 2025-04-19 13:42:54 +00:00
chat_command_ufo_mode 1.0.0
This commit is contained in:
parent
5001fc8b8f
commit
05fdd3c679
@ -255,6 +255,29 @@ Prints how to use the `commands` and the `help command` commands in the player's
|
|||||||
|---|
|
|---|
|
||||||
| 1 |
|
| 1 |
|
||||||
|
|
||||||
|
## chat_command_ufo_mode.gsc
|
||||||
|
|
||||||
|
Toggles whether the targeted player can use the ufo mode or not.
|
||||||
|
This allows the player to fly around the map by holding the melee button and, if death barrier protection is on, to get out of map without dying.
|
||||||
|
|
||||||
|
The death barrier protection is on by default.
|
||||||
|
In ZM it will remove the death barriers for the entire team.
|
||||||
|
In MP it will put the player in god mode until disabling UFO mode (running the command again).
|
||||||
|
If the player had god mode from the god mode chat command he will keep the god mode.
|
||||||
|
|
||||||
|
| # | Argument | Mandatory |
|
||||||
|
|---|---|---|
|
||||||
|
| 1 | The name of the player to toggle ufo mode for | :white_check_mark: |
|
||||||
|
|
||||||
|
| Examples |
|
||||||
|
|---|
|
||||||
|
| `!ufomode me` |
|
||||||
|
| `!ufomode Resxt` |
|
||||||
|
|
||||||
|
| Permission level |
|
||||||
|
|---|
|
||||||
|
| 3 |
|
||||||
|
|
||||||
## chat_command_unfair_aimbot.gsc
|
## chat_command_unfair_aimbot.gsc
|
||||||
|
|
||||||
Toggles unfair aimbot on the targeted player.
|
Toggles unfair aimbot on the targeted player.
|
||||||
|
117
chat_commands/chat_command_ufo_mode.gsc
Normal file
117
chat_commands/chat_command_ufo_mode.gsc
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
#include scripts\chat_commands;
|
||||||
|
|
||||||
|
Init()
|
||||||
|
{
|
||||||
|
// change to false to disable death barrier protection
|
||||||
|
// in ZM: no death barrier for all players during the entire game
|
||||||
|
// in MP: constant god mode for the player who's in UFO mode until toggling ufo off
|
||||||
|
level.chat_commands_protect_from_death_barriers = true;
|
||||||
|
|
||||||
|
if (level.chat_commands_protect_from_death_barriers && !IsMultiplayerMode())
|
||||||
|
{
|
||||||
|
level.player_out_of_playable_area_monitor = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
CreateCommand(level.chat_commands["ports"], "ufomode", "function", ::UfoModeCommand, 3, array("default_help_one_player"), array("ufo"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Command section */
|
||||||
|
|
||||||
|
UfoModeCommand(args)
|
||||||
|
{
|
||||||
|
if (args.size < 1)
|
||||||
|
{
|
||||||
|
return NotEnoughArgsError(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
error = ToggleUfoMode(args[0]);
|
||||||
|
|
||||||
|
if (IsDefined(error))
|
||||||
|
{
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Logic section */
|
||||||
|
|
||||||
|
ToggleUfoMode(playerName)
|
||||||
|
{
|
||||||
|
player = FindPlayerByName(playerName);
|
||||||
|
|
||||||
|
if (!IsDefined(player))
|
||||||
|
{
|
||||||
|
return PlayerDoesNotExistError(playerName);
|
||||||
|
}
|
||||||
|
|
||||||
|
commandName = "ufo";
|
||||||
|
|
||||||
|
ToggleStatus(commandName, "Ufo Mode", player);
|
||||||
|
|
||||||
|
if (GetStatus(commandName, player))
|
||||||
|
{
|
||||||
|
player thread DoUfoMode();
|
||||||
|
player thread ThreadUfoMode();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player notify("chat_commands_ufo_mode_off");
|
||||||
|
|
||||||
|
if (IsMultiplayerMode() && !GetStatus("god", player))
|
||||||
|
{
|
||||||
|
self DisableInvulnerability();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ThreadUfoMode()
|
||||||
|
{
|
||||||
|
self endon("disconnect");
|
||||||
|
self endon("chat_commands_ufo_mode_off");
|
||||||
|
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
self waittill("spawned_player");
|
||||||
|
|
||||||
|
self DoUfoMode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DoUfoMode()
|
||||||
|
{
|
||||||
|
self endon("disconnect");
|
||||||
|
self endon("death");
|
||||||
|
self endon("chat_commands_ufo_mode_off");
|
||||||
|
|
||||||
|
if (level.chat_commands_protect_from_death_barriers && IsMultiplayerMode())
|
||||||
|
{
|
||||||
|
self EnableInvulnerability();
|
||||||
|
}
|
||||||
|
|
||||||
|
self.fly = 0;
|
||||||
|
UFO = Spawn("script_model", self.origin);
|
||||||
|
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
if(self MeleeButtonPressed())
|
||||||
|
{
|
||||||
|
self PlayerLinkTo(UFO);
|
||||||
|
self.fly = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self Unlink();
|
||||||
|
self.fly = 0;
|
||||||
|
}
|
||||||
|
if(self.fly == 1)
|
||||||
|
{
|
||||||
|
fly = self.origin + VectorScale(AnglesToForward(self GetPlayerAngles()), 20);
|
||||||
|
UFO MoveTo(fly, .01);
|
||||||
|
}
|
||||||
|
|
||||||
|
wait 0.05;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user