Make it easier to change the max tier
Some checks failed
Compile / Build SM ${{ matrix.sm-version }} (1.12) (push) Has been cancelled
Compile / Release (push) Has been cancelled

This commit is contained in:
rtldg 2025-09-30 23:57:30 +00:00
parent a350d7982c
commit 7cbb250541

View File

@ -631,9 +631,11 @@ public Action Command_SetTier(int client, int args)
int tier = StringToInt(sArg); int tier = StringToInt(sArg);
if(args == 0 || tier < 1 || tier > 10) int maxtier = GetMaxTier();
if(args == 0 || tier < 1 || tier > maxtier)
{ {
ReplyToCommand(client, "%T", "ArgumentsMissing", client, "sm_settier <tier> (1-10) [map]"); ReplyToCommand(client, "%T", "ArgumentsMissing", client, "sm_settier <tier> (1-%d) [map]", maxtier);
return Plugin_Handled; return Plugin_Handled;
} }
@ -1722,3 +1724,10 @@ public void SQL_DeleteMap_Callback(Database db, DBResultSet results, const char[
UpdateAllPoints(true); UpdateAllPoints(true);
} }
} }
int GetMaxTier()
{
float val = 10.0;
gCV_DefaultTier.GetBounds(ConVarBound_Upper, val);
return RoundToFloor(val);
}