chat_command_norecoil 1.0.0

This commit is contained in:
Resxt 2023-02-16 04:15:15 +01:00
parent 3384aef34f
commit 1a4c6a3cee
2 changed files with 60 additions and 0 deletions

View File

@ -45,6 +45,15 @@ Example: `!changteam Resxt`
| mode | Charges a new DSR/mode on the server and restarts the current map | (1) the DSR file name, found in the `admin` folder of your game | `!mode FFA_default` | | mode | Charges a new DSR/mode on the server and restarts the current map | (1) the DSR file name, found in the `admin` folder of your game | `!mode FFA_default` |
| mapmode | Charges a new DSR/mode on the server and rotates to the requested map | (1) the map codename (2) the DSR file name, found in the `admin` folder of your game | `!mapmode mp_seatown TDM_default` | | mapmode | Charges a new DSR/mode on the server and rotates to the requested map | (1) the map codename (2) the DSR file name, found in the `admin` folder of your game | `!mapmode mp_seatown TDM_default` |
## chat_command_norecoil.gsc
Toggles norecoil on the targeted player
| Examples |
|---|
| `!norecoil me` |
| `!norecoil Resxt` |
## chat_command_suicide.gsc ## chat_command_suicide.gsc
The player who runs the command dies. The player who runs the command dies.

View File

@ -0,0 +1,51 @@
#include scripts\chat_commands;
Init()
{
CreateCommand(level.commands_servers_ports, "norecoil", "function", ::NoRecoilCommand, ["default_help_one_player"]);
}
/* Command section */
NoRecoilCommand(args)
{
if (args.size < 1)
{
return NotEnoughArgsError(1);
}
error = ToggleNoRecoil(args[0]);
if (IsDefined(error))
{
return error;
}
}
/* Logic section */
ToggleNoRecoil(playerName)
{
player = FindPlayerByName(playerName);
if (!IsDefined(player))
{
return PlayerDoesNotExistError(playerName);
}
recoilModifier = 100;
if (IsDefined(player.recoilscale) && player.recoilscale == 100)
{
recoilModifier = 0;
}
player maps\mp\_utility::setrecoilscale( recoilModifier, recoilModifier );
player.recoilscale = recoilModifier;
ToggleStatus("no_recoil", "No Recoil", player);
}