mirror of
https://github.com/Resxt/Plutonium-IW5-Scripts.git
synced 2025-04-19 20:52:54 +00:00
chat_command_unlimited_ammo 1.0.0
This commit is contained in:
parent
b308c84758
commit
e866fd5b26
@ -145,6 +145,19 @@ Prints the server rules in the player's chat.
|
|||||||
|---|
|
|---|
|
||||||
| `!rules` |
|
| `!rules` |
|
||||||
|
|
||||||
|
## chat_command_unlimited_ammo.gsc
|
||||||
|
|
||||||
|
Toggles unlimited ammo on the targeted player.
|
||||||
|
|
||||||
|
| # | Argument | Mandatory |
|
||||||
|
|---|---|---|
|
||||||
|
| 1 | The name of the player to toggle unlimited ammo for | :white_check_mark: |
|
||||||
|
|
||||||
|
| Examples |
|
||||||
|
|---|
|
||||||
|
| `!unlimitedammo me` |
|
||||||
|
| `!unlimitedammo Resxt` |
|
||||||
|
|
||||||
## chat_command_wallhack.gsc
|
## chat_command_wallhack.gsc
|
||||||
|
|
||||||
Toggles wallhack (red boxes) on the targeted player.
|
Toggles wallhack (red boxes) on the targeted player.
|
||||||
|
96
chat_commands/chat_command_unlimited_ammo.gsc
Normal file
96
chat_commands/chat_command_unlimited_ammo.gsc
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
#include scripts\chat_commands;
|
||||||
|
|
||||||
|
Init()
|
||||||
|
{
|
||||||
|
CreateCommand(level.commands_servers_ports, "unlimitedammo", "function", ::UnlimitedAmmoCommand, ["default_help_one_player"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Command section */
|
||||||
|
|
||||||
|
UnlimitedAmmoCommand(args)
|
||||||
|
{
|
||||||
|
if (args.size < 1)
|
||||||
|
{
|
||||||
|
return NotEnoughArgsError(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
error = ToggleUnlimitedAmmo(args[0]);
|
||||||
|
|
||||||
|
if (IsDefined(error))
|
||||||
|
{
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Logic section */
|
||||||
|
|
||||||
|
ToggleUnlimitedAmmo(playerName)
|
||||||
|
{
|
||||||
|
player = FindPlayerByName(playerName);
|
||||||
|
|
||||||
|
if (!IsDefined(player))
|
||||||
|
{
|
||||||
|
return PlayerDoesNotExistError(playerName);
|
||||||
|
}
|
||||||
|
|
||||||
|
commandName = "unlimitedammo";
|
||||||
|
|
||||||
|
ToggleStatus(commandName, "Unlimited Ammo", player);
|
||||||
|
|
||||||
|
if (GetStatus(commandName, player))
|
||||||
|
{
|
||||||
|
player thread DoUnlimitedAmmo();
|
||||||
|
player thread ThreadUnlimitedAmmo();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player notify("chat_commands_unlimited_ammo_off");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ThreadUnlimitedAmmo()
|
||||||
|
{
|
||||||
|
self endon("disconnect");
|
||||||
|
self endon("chat_commands_unlimited_ammo_off");
|
||||||
|
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
self waittill("spawned_player");
|
||||||
|
|
||||||
|
self thread DoUnlimitedAmmo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DoUnlimitedAmmo()
|
||||||
|
{
|
||||||
|
self endon("chat_commands_unlimited_ammo_off");
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
currentWeapon = self getCurrentWeapon();
|
||||||
|
currentoffhand = self GetCurrentOffhand();
|
||||||
|
|
||||||
|
if (currentWeapon != "none")
|
||||||
|
{
|
||||||
|
self SetWeaponAmmoClip(currentWeapon, 9999);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsSubStr(currentWeapon, "akimbo"))
|
||||||
|
{
|
||||||
|
self SetWeaponAmmoClip(currentWeapon, 9999, "left");
|
||||||
|
self SetWeaponAmmoClip(currentWeapon, 9999, "right");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( currentoffhand != "none" )
|
||||||
|
{
|
||||||
|
self setWeaponAmmoClip( currentoffhand, 9999 );
|
||||||
|
self GiveMaxAmmo( currentoffhand );
|
||||||
|
}
|
||||||
|
|
||||||
|
wait 0.05;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user