mirror of
https://github.com/Resxt/Plutonium-IW5-Scripts.git
synced 2025-04-19 12:42:54 +00:00
chat_command_norecoil 1.0.0
This commit is contained in:
parent
3384aef34f
commit
1a4c6a3cee
@ -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` |
|
||||
| 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
|
||||
|
||||
The player who runs the command dies.
|
||||
|
51
chat_commands/chat_command_norecoil.gsc
Normal file
51
chat_commands/chat_command_norecoil.gsc
Normal 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);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user