diff --git a/chat_commands/zm/README.md b/chat_commands/zm/README.md index 9278dcd..826bb2b 100644 --- a/chat_commands/zm/README.md +++ b/chat_commands/zm/README.md @@ -14,6 +14,11 @@ Alternatively you can use [this](https://github.com/plutoniummod/t6-scripts/blob Note that like other scripts on this page this is a ZM only script, but this script also has a global version (works in both MP and ZM) that you can find [here](../chat_command_give.gsc) if you're looking for more give commands. You can have both installed at the same time as long as this script is in the `zm` folder and the global version is either in the `scripts` folder or the `mp` folder. +| More examples | +|---| +| `!givepowerup all` | +| `!givepowerup all_no_nuke` | + ## chat_command_no_target.gsc Toggles whether the targeted player is in no target mode (invisible to zombies) or not. diff --git a/chat_commands/zm/chat_command_give.gsc b/chat_commands/zm/chat_command_give.gsc index 9fb2301..835e146 100644 --- a/chat_commands/zm/chat_command_give.gsc +++ b/chat_commands/zm/chat_command_give.gsc @@ -30,12 +30,37 @@ GivePowerupCommand(args) GivePlayerPowerup(powerupName) { - if (IsValidPowerup(powerupName)) + powerupName = ToLower(powerupName); + + if (powerupName == "all") { - level thread maps\mp\zombies\_zm_powerups::specific_powerup_drop(powerupName, self.origin); + foreach (powerup in GetAvailablePowerups()) + { + level thread maps\mp\zombies\_zm_powerups::specific_powerup_drop(powerup, self.origin); + } + } + else if (powerupName == "allbutnuke" || powerupName == "all_but_nuke" || powerupName == "allnonuke" || powerupName == "all_no_nuke") + { + foreach (powerup in GetAvailablePowerups()) + { + if (powerup != "nuke") + { + level thread maps\mp\zombies\_zm_powerups::specific_powerup_drop(powerup, self.origin); + } + } } else { - return PowerupDoesNotExistError(powerupName); + if (IsValidPowerup(powerupName)) + { + level thread maps\mp\zombies\_zm_powerups::specific_powerup_drop(powerupName, self.origin); + } + else + { + return PowerupDoesNotExistError(powerupName); + } + } +} + } } \ No newline at end of file