Skip to content

Commit 47689ed

Browse files
RankRestrictions: Add CMSStats (#244)
Co-authored-by: STEELZZZ <[email protected]>
1 parent bafdbf1 commit 47689ed

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

cstrike/addons/amxmodx/configs/plugins/ChatAdditions/CA_Addon_RankRestrictions.cfg

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// 1 - Level restrictions
88
// 2 - Kills count restrictions
99
// -
10-
// Default: "2"
10+
// Default: "1"
1111
// Minimum: "0.000000"
1212
// Maximum: "2.000000"
1313
ca_rankrestrictions_type "1"
@@ -22,10 +22,11 @@ ca_rankrestrictions_min_kills "10"
2222
// 0 - Advanced Experience System
2323
// 1 - Army Ranks Ultimate
2424
// 2 - OciXCrom's Rank System
25+
// 3 - CMSStats Ranks
2526
// -
2627
// Default: "1"
2728
// Minimum: "0.000000"
28-
// Maximum: "2.000000"
29+
// Maximum: "3.000000"
2930
ca_rankrestrictions_type_level "1"
3031

3132
// Min Level to access voice & text chat

cstrike/addons/amxmodx/scripting/CA_Addon_RankRestrictions.sma

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
native aes_get_player_level(const player)
88
native ar_get_user_level(const player, rankName[] = "", len = 0)
99
native crxranks_get_user_level(const player)
10-
10+
native cmsranks_get_user_level(id, szLevel[] = "", len = 0)
1111
native csstats_get_user_stats(const player, const stats[22])
1212
//
1313

@@ -50,6 +50,9 @@ public native_filter(const name[], index, trap) {
5050
if(strcmp(name, "csstats_get_user_stats"))
5151
return PLUGIN_HANDLED
5252

53+
if(strcmp(name, "cmsranks_get_user_level"))
54+
return PLUGIN_HANDLED;
55+
5356
return PLUGIN_CONTINUE
5457
}
5558

@@ -74,9 +77,10 @@ static Register_CVars() {
7477
.description = "Level System Types\n\
7578
0 - Advanced Experience System\n\
7679
1 - Army Ranks Ultimate\n\
77-
2 - OciXCrom's Rank System",
80+
2 - OciXCrom's Rank System\n\
81+
3 - CMSStats Ranks",
7882
.has_min = true, .min_val = 0.0,
79-
.has_max = true, .max_val = 2.0
83+
.has_max = true, .max_val = 3.0
8084
), ca_rankrestrictions_type_level
8185
)
8286

@@ -150,6 +154,7 @@ static GetUserLevel(const player) {
150154
case 0: return aes_get_player_level(player)
151155
case 1: return ar_get_user_level(player)
152156
case 2: return crxranks_get_user_level(player)
157+
case 3: return cmsranks_get_user_level(player)
153158
}
154159

155160
return 0

0 commit comments

Comments
 (0)