/**
*
* Name: Rank Menu
* Version: 1.1
* Author: h1k3
*
* Requirements: AmxModX 1.8.2 or higher
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses#5A96B43F-5D7>
*
*/
#include <amxmodx>
#include <csstats_mysql>
#include <army_ranks_ultimate>
public plugin_init() {
register_plugin("Rank Menu", "1.1", "h1k3");
register_clcmd("say /rank", "CmdRank");
register_clcmd("say_team /rank", "CmdRank");
}
public CmdRank(id) {
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));
if (rank <= 0) {
client_print(id, print_chat, "Статистика недоступна. Повторите позже.")
}
new tag[32];
new level = ar_get_user_level(id, tag, charsmax(tag));
new msg[512], len;
len += formatex(msg[len], charsmax(msg) - len, "^t\wВы занимаете \r%d-е \wместо из \r%d^n", rank, num);
len += formatex(msg[len], charsmax(msg) - len, "^t\wСкилл \r%s \d| \wУровень \r%d \w(\y%s\w)^n", letter, level, tag);
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;
}
stock getSkillLetter(skill, letter[], len) {
if (skill < 60) {
copy(letter, len, "L-");
} else if (60 <= skill < 75) {
copy(letter, len, "L");
} else if (75 <= skill < 85) {
copy(letter, len, "L+");
} else if (85 <= skill < 100) {
copy(letter, len, "M-");
} else if (100 <= skill < 115) {
copy(letter, len, "M");
} else if (115 <= skill < 130) {
copy(letter, len, "M+");
} else if (130 <= skill < 140) {
copy(letter, len, "H-");
} else if (140 <= skill < 150) {
copy(letter, len, "H");
} else if (150 <= skill < 165) {
copy(letter, len, "H+");
} else if (165 <= skill < 180) {
copy(letter, len, "P-");
} else if (180 <= skill < 195) {
copy(letter, len, "P");
} else if (195 <= skill < 210) {
copy(letter, len, "P+");
} else {
copy(letter, len, "G");
}
}