@@ -9,14 +9,18 @@ native ar_get_user_level(const player, rankName[] = "", len = 0)
99native crxranks_get_user_level(const player)
1010native cmsranks_get_user_level(id, szLevel[] = " " , len = 0 )
1111native csstats_get_user_stats(const player, const stats[22 ])
12+ native Float: cmsstats_get_user_skill(index, skillname[] = " " , namelen = 0 , & skill_level = 0 );
13+ native get_user_skill (player,& Float: skill)
14+ native get_user_stats(index,stats[STATSX_MAX_STATS],bodyhits[MAX_BODYHITS]);
1215//
1316
1417
1518static ca_rankrestrictions_type,
1619 ca_rankrestrictions_min_kills,
1720 ca_rankrestrictions_type_level,
1821 ca_rankrestrictions_min_level,
19- ca_rankrestrictions_immunity_flag[16 ]
22+ ca_rankrestrictions_immunity_flag[16 ],
23+ ca_rankrestrictions_type_kills
2024
2125public stock const PluginName[] = " CA Addon: Rank restrictions"
2226public stock const PluginVersion[] = CA_VERSION
@@ -53,6 +57,12 @@ public native_filter(const name[], index, trap) {
5357 if (strcmp (name, " cmsranks_get_user_level" ))
5458 return PLUGIN_HANDLED;
5559
60+ if (strcmp (name, " cmsstats_get_user_skill" ))
61+ return PLUGIN_HANDLED;
62+
63+ if (strcmp (name, " get_user_stats" ))
64+ return PLUGIN_HANDLED;
65+
5666 return PLUGIN_CONTINUE
5767}
5868
@@ -78,9 +88,12 @@ static Register_CVars() {
7888 0 - Advanced Experience System\n \
7989 1 - Army Ranks Ultimate\n \
8090 2 - OciXCrom's Rank System\n \
81- 3 - CMSStats Ranks" ,
91+ 3 - CMSStats Ranks\n \
92+ 4 - CMSStats MySQL\n \
93+ 5 - CSstatsX SQL\n \
94+ 6 - CSX Module" ,
8295 .has_min = true , .min_val = 0 .0 ,
83- .has_max = true , .max_val = 3 .0
96+ .has_max = true , .max_val = 6 .0
8497 ), ca_rankrestrictions_type_level
8598 )
8699
@@ -95,6 +108,15 @@ static Register_CVars() {
95108 ),
96109 ca_rankrestrictions_immunity_flag, charsmax (ca_rankrestrictions_immunity_flag)
97110 )
111+
112+ bind_pcvar_num (create_cvar (" ca_rankrestrictions_type_kills" , " 1" ,
113+ .description = " Kill System Types\n \
114+ 0 - CSStats MySQL\n \
115+ 1 - CSX Module" ,
116+ .has_min = true , .min_val = 0 .0 ,
117+ .has_max = true , .max_val = 1 .0
118+ ), ca_rankrestrictions_type_kills
119+ )
98120}
99121
100122public CA_Client_Say (player) {
@@ -155,16 +177,47 @@ static GetUserLevel(const player) {
155177 case 1 : return ar_get_user_level (player)
156178 case 2 : return crxranks_get_user_level (player)
157179 case 3 : return cmsranks_get_user_level (player)
180+ case 4 :
181+ {
182+ new iSkill
183+ cmsstats_get_user_skill (player, .skill_level = iSkill)
184+ return iSkill
185+ }
186+ case 5 :
187+ {
188+ new Float: iSkill
189+ get_user_skill (player, iSkill)
190+ return floatround (iSkill)
191+ }
192+ case 6 :
193+ {
194+ new iStats[STATSX_MAX_STATS], iHits[MAX_BODYHITS]
195+ get_user_stats (player, iStats, iHits)
196+ return iStats[STATSX_RANK]
197+ }
158198 }
159199
160200 return 0
161201}
162202
163203static GetUserFragsFromStats (const player) {
164- enum { stats_Frags/* , stats_Deaths, stats_Rounds = 16 */ }
165-
166- new stats[22 ]
167- csstats_get_user_stats (player, stats)
168-
169- return stats[stats_Frags]
204+ enum { stats_Frags/* , stats_Deaths, stats_Rounds = 16 */ }
205+
206+ switch (ca_rankrestrictions_type_kills)
207+ {
208+ case 0 :
209+ {
210+ new stats[22 ]
211+ csstats_get_user_stats (player, stats)
212+ return stats[stats_Frags]
213+ }
214+ case 1 :
215+ {
216+ new iStats[STATSX_MAX_STATS], iHits[MAX_BODYHITS]
217+ get_user_stats (player, iStats, iHits)
218+ return iStats[STATSX_KILLS]
219+ }
220+ }
221+
222+ return 0
170223}
0 commit comments