#include <amxmodx>
+#include <csstats_mysql>
+#include <army_ranks_ultimate>
#define STATS_TYPE
#define LEVEL_TYPE
-#if STATS_TYPE == 0
-#include <csx>
-#endif
-#if STATS_TYPE == 1
-#include <csstatsx_sql>
-#endif
-#if STATS_TYPE == 2
-#include <csstats_mysql>
-#endif
-#if STATS_TYPE == 3
-#include <csx>
-native Float:mars_get_skill(player);
-#endif
-#if STATS_TYPE < 0 || STATS_TYPE > 3
-#error 'Unsupported STATS_TYPE value'
-#endinput
-#endif
-#if LEVEL_TYPE == 1
-#include <aes_v>
-#elseif LEVEL_TYPE == 2
-#include <army_ranks_ultimate>
-#elseif LEVEL_TYPE < 0 || LEVEL_TYPE > 2
-#error 'Unsupported LEVEL_TYPE value'
-#endinput
-#endif
public plugin_init() {
register_plugin("Rank Menu", "1.1", "h1k3");
register_clcmd("say /rank", "CmdRank");
register_clcmd("say_team /rank", "CmdRank");
}
public CmdRank(id) {
-#if STATS_TYPE == 0
- new stats[8], bodyhits[8];
- new rank = get_user_stats(id, stats, bodyhits);
- new num = get_statsnum();
-#endif
-#if STATS_TYPE == 1
- new stats[8], bodyhits[8];
- new rank = get_user_stats_sql(id, stats, bodyhits);
- new num = get_statsnum_sql();
- new Float:skill, letter[3];
- get_user_skill(id, skill);
- getSkillLetter(floatround(skill), letter, charsmax(letter));
-#endif
-#if STATS_TYPE == 2
new stats[22];
new rank = csstats_get_user_stats(id, stats);
new num = csstats_get_statsnum();
new letter[3];
getSkillLetter(stats[SKILL], letter, charsmax(letter));
-#endif
-#if STATS_TYPE == 3
- new stats[8], bodyhits[8];
- new rank = get_user_stats(id, stats, bodyhits);
- new num = get_statsnum();
- new letter[3];
- new Float:skill = mars_get_skill(id);
- getSkillLetter(floatround(skill), letter, charsmax(letter));
-#endif
if (rank <= 0) {
client_print(id, print_chat, "Статистика недоступна. Повторите позже.")
}
-#if LEVEL_TYPE == 1
- new tag[32];
- new level = aes_get_player_level(id);
- aes_get_level_name(level, tag, charsmax(tag), id);
-#elseif LEVEL_TYPE == 2
new tag[32];
new level = ar_get_user_level(id, tag, charsmax(tag));
-#endif
new msg[512], len;
len += formatex(msg[len], charsmax(msg) - len, "^t\wВы занимаете \r%d-е \wместо из \r%d^n", rank, num);
-#if STATS_TYPE != 0 && LEVEL_TYPE != 0
len += formatex(msg[len], charsmax(msg) - len, "^t\wСкилл \r%s \d| \wУровень \r%d \w(\y%s\w)^n", letter, level, tag);
-#elseif STATS_TYPE != 0 && LEVEL_TYPE == 0
- len += formatex(msg[len], charsmax(msg) - len, "^t\wСкилл \r%s^n", letter);
-#elseif STATS_TYPE == 0 && LEVEL_TYPE != 0
- len += formatex(msg[len], charsmax(msg) - len, "^t\wУровень \r%d \w(\y%s\w)^n", level, tag);
-#endif
len += formatex(msg[len], charsmax(msg) - len, "^t\wУбийств \r%d \d| \wСмертей \r%d^n", stats[0], stats[1]);
len += formatex(msg[len], charsmax(msg) - len, "^t\wУбийств в голову \r%d^n", stats[2]);
len += formatex(msg[len], charsmax(msg) - len, "^t\wВыстрелов \r%d \d| \wПопаданий \r%d^n", stats[4], stats[5]);
show_menu(id, 1023, msg, 5);
return PLUGIN_HANDLED;
}