From 994e69632e5d6c034ea7bc147e5f442531c75df5 Mon Sep 17 00:00:00 2001 From: Resxt <55228336+Resxt@users.noreply.github.com> Date: Thu, 16 Feb 2023 16:27:49 +0100 Subject: [PATCH] chat_commands 1.2.1 Added DvarDoesNotExistError error Added DvarIsInitialized util function --- chat_commands/chat_commands.gsc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/chat_commands/chat_commands.gsc b/chat_commands/chat_commands.gsc index 341c63d..d83f791 100644 --- a/chat_commands/chat_commands.gsc +++ b/chat_commands/chat_commands.gsc @@ -228,6 +228,11 @@ PlayerDoesNotExistError(playerName) return ["Player " + playerName + " was not found"]; } +DvarDoesNotExistError(dvarName) +{ + return ["The dvar " + dvarName + " doesn't exist"]; +} + /* Utils section */ @@ -295,6 +300,12 @@ SetStatus(commandName, player, status) player.chat_commands["status"][commandName] = status; } +DvarIsInitialized(dvarName) +{ + result = GetDvar(dvarName); + return result != ""; +} + AddElementToArray(array, element) { array[array.size] = element;