Skip to content

Commit 7cbb250

Browse files
committed
Make it easier to change the max tier
1 parent a350d79 commit 7cbb250

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

addons/sourcemod/scripting/shavit-rankings.sp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,9 +631,11 @@ public Action Command_SetTier(int client, int args)
631631

632632
int tier = StringToInt(sArg);
633633

634-
if(args == 0 || tier < 1 || tier > 10)
634+
int maxtier = GetMaxTier();
635+
636+
if(args == 0 || tier < 1 || tier > maxtier)
635637
{
636-
ReplyToCommand(client, "%T", "ArgumentsMissing", client, "sm_settier <tier> (1-10) [map]");
638+
ReplyToCommand(client, "%T", "ArgumentsMissing", client, "sm_settier <tier> (1-%d) [map]", maxtier);
637639

638640
return Plugin_Handled;
639641
}
@@ -1722,3 +1724,10 @@ public void SQL_DeleteMap_Callback(Database db, DBResultSet results, const char[
17221724
UpdateAllPoints(true);
17231725
}
17241726
}
1727+
1728+
int GetMaxTier()
1729+
{
1730+
float val = 10.0;
1731+
gCV_DefaultTier.GetBounds(ConVarBound_Upper, val);
1732+
return RoundToFloor(val);
1733+
}

0 commit comments

Comments
 (0)