From fb57ea3c4ef76f6f057e32f58dee6f1ffa200c33 Mon Sep 17 00:00:00 2001 From: Resxt <55228336+Resxt@users.noreply.github.com> Date: Fri, 27 Oct 2023 13:54:25 +0200 Subject: [PATCH] chat_commands 1.1.5 Added PowerupDoesNotExistError Added GetAvailablePowerups util function Added IsValidPowerup util function --- chat_commands/chat_commands.gsc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/chat_commands/chat_commands.gsc b/chat_commands/chat_commands.gsc index d9fbd92..73d466e 100644 --- a/chat_commands/chat_commands.gsc +++ b/chat_commands/chat_commands.gsc @@ -514,6 +514,11 @@ NotEnoughPointsError() return array("You don't have enough points to do that"); } +PowerupDoesNotExistError(powerupName) +{ + return array("The powerup " + powerupName + " doesn't exist or isn't available on this map"); +} + /* Utils section */ @@ -744,4 +749,24 @@ IsValidWeapon(weaponName) weaponIndex = getbaseweaponitemindex(weaponName); return weaponIndex != 0; +} + +GetAvailablePowerups() +{ + powerups = []; + + foreach (powerup in GetArrayKeys(level.zombie_powerups)) + { + if (powerup != "insta_kill_ug") + { + powerups = AddElementToArray(powerups, powerup); + } + } + + return powerups; +} + +IsValidPowerup(powerupName) +{ + return IsInArray(GetAvailablePowerups(), powerupName); } \ No newline at end of file