chat_commands 1.2.1

Added DvarDoesNotExistError error
Added DvarIsInitialized util function
This commit is contained in:
Resxt 2023-02-16 16:27:49 +01:00
parent e866fd5b26
commit 994e69632e

View File

@ -228,6 +228,11 @@ PlayerDoesNotExistError(playerName)
return ["Player " + playerName + " was not found"]; return ["Player " + playerName + " was not found"];
} }
DvarDoesNotExistError(dvarName)
{
return ["The dvar " + dvarName + " doesn't exist"];
}
/* Utils section */ /* Utils section */
@ -295,6 +300,12 @@ SetStatus(commandName, player, status)
player.chat_commands["status"][commandName] = status; player.chat_commands["status"][commandName] = status;
} }
DvarIsInitialized(dvarName)
{
result = GetDvar(dvarName);
return result != "";
}
AddElementToArray(array, element) AddElementToArray(array, element)
{ {
array[array.size] = element; array[array.size] = element;