Вот код исходника:
Скрытый текст
#include <amxmodx> #include <fun> #include <cstrike> new givingweapon[33], givepack[33] public plugin_init() { register_plugin("WeaponMenu", "1.0", "UNREAL") // Название плагина (Не менять сцуко!) register_clcmd("weaponmenu", "cmdmenu") } public cmdmenu(id) { if(!(get_user_flags(id) & ADMIN_LEVEL_<img src='http://forum.myarena.ru/public/style_emoticons/<#EMO_DIR#>/cool.png' class='bbc_emoticon' alt='B)' />) return PLUGIN_HANDLED givingweapon[id] = 0 new menu = menu_create("\rВыберите раздел", "g_menu_handler") menu_additem(menu, "Пистолеты", "1") menu_additem(menu, "Автоматы", "2") menu_additem(menu, "Винтовки", "3") menu_additem(menu, "Снаряжение", "4") menu_additem(menu, "Комплекты оружия", "5") menu_setprop(menu, MPROP_EXITNAME, "Выход") menu_display(id, menu, 0) return PLUGIN_HANDLED } public g_menu_handler(id, menu, item) { if (item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED } new s_Data[6], s_Name[64], i_Access, i_Callback menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback) new Key = str_to_num(s_Data) switch(Key) { case 1: cmdpistols(id) case 2: cmdautom(id) case 3: cmdrifles(id) case 4: cmdsecond(id) case 5: cmdpack(id) } menu_destroy(menu) return PLUGIN_HANDLED } public cmdpistols(id) { new menu = menu_create("\rВыберите оружие", "pi_menu_handler") menu_additem(menu, "Glock 18", "1") menu_additem(menu, "USP", "2") menu_additem(menu, "P228", "3") menu_additem(menu, "Deagle", "4") menu_additem(menu, "FiveSeven", "5") menu_additem(menu, "Elite", "6") menu_setprop(menu, MPROP_EXITNAME, "Выход") menu_display(id, menu, 0) } public pi_menu_handler(id, menu, item) { if (item == MENU_EXIT) { //cmdmenu(id) menu_destroy(menu) return PLUGIN_HANDLED } new s_Data[6], s_Name[64], i_Access, i_Callback menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback) new Key = str_to_num(s_Data) switch(Key) { case 1: cmdgivepist(id, 17) case 2: cmdgivepist(id, 16) case 3: cmdgivepist(id, 1) case 4: cmdgivepist(id, 26) case 5: cmdgivepist(id, 11) case 6: cmdgivepist(id, 10) } menu_destroy(menu) return PLUGIN_HANDLED } public cmdgivepist(id, weapon) { givingweapon[id] = weapon new menu = menu_create("\rВыберите игрока", "p2_menu_handler") new s_Players[32], i_Num, i_Player new s_Name[64], s_Player[10] get_players(s_Players, i_Num) for (new i; i < i_Num; i++) { i_Player = s_Players[i] get_user_name(i_Player, s_Name, charsmax(s_Name)) num_to_str(i_Player, s_Player, charsmax(s_Player)) if(is_user_alive(i_Player)) format(s_Name, charsmax(s_Name), "\w%s", s_Name) else format(s_Name, charsmax(s_Name), "\d%s", s_Name) menu_additem(menu, s_Name, s_Player, 0) } menu_setprop(menu, MPROP_NEXTNAME, "Далее") menu_setprop(menu, MPROP_BACKNAME, "Назад") menu_setprop(menu, MPROP_EXITNAME, "Выход") menu_display(id, menu, 0) } public p2_menu_handler(id, menu, item) { if (item == MENU_EXIT) { //cmdpistols(id) menu_destroy(menu) return PLUGIN_HANDLED } new s_Data[6], s_Name[64], i_Access, i_Callback menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback) new i_Player = str_to_num(s_Data) if(is_user_connected(i_Player) && is_user_alive(i_Player)) { switch(givingweapon[id]) { case 17: { cs_set_user_bpammo(i_Player, givingweapon[id], 120) give_item(i_Player, "weapon_glock18") } case 16: { cs_set_user_bpammo(i_Player, givingweapon[id], 100) give_item(i_Player, "weapon_usp") } case 1: { cs_set_user_bpammo(i_Player, givingweapon[id], 52) give_item(i_Player, "weapon_p228") } case 26: { cs_set_user_bpammo(i_Player, givingweapon[id], 35) give_item(i_Player, "weapon_deagle") } case 11: { cs_set_user_bpammo(i_Player, givingweapon[id], 100) give_item(i_Player, "weapon_fiveseven") } case 10: { cs_set_user_bpammo(i_Player, givingweapon[id], 120) give_item(i_Player, "weapon_elite") } } } cmdgivepist(id, givingweapon[id]) menu_destroy(menu) return PLUGIN_HANDLED } public cmdautom(id) { new menu = menu_create("\rВыберите оружие", "aut_menu_handler") menu_additem(menu, "Benelli M3 Super", "1") menu_additem(menu, "Benelli XM1014", "2") menu_additem(menu, "Ingram MAC-10", "3") menu_additem(menu, "Steyr TMP", "4") menu_additem(menu, "HK MP5", "5") menu_additem(menu, "HK UMP 45", "6") menu_additem(menu, "FN P90", "7") menu_setprop(menu, MPROP_EXITNAME, "Выход") menu_display(id, menu, 0) } public aut_menu_handler(id, menu, item) { if (item == MENU_EXIT) { //cmdmenu(id) menu_destroy(menu) return PLUGIN_HANDLED } new s_Data[6], s_Name[64], i_Access, i_Callback menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback) new Key = str_to_num(s_Data) switch(Key) { case 1: cmdgiveautom(id, 21) case 2: cmdgiveautom(id, 5) case 3: cmdgiveautom(id, 7) case 4: cmdgiveautom(id, 23) case 5: cmdgiveautom(id, 19) case 6: cmdgiveautom(id, 12) case 7: cmdgiveautom(id, 30) } menu_destroy(menu) return PLUGIN_HANDLED } public cmdgiveautom(id, weapon) { givingweapon[id] = weapon new menu = menu_create("\rВыберите игрока", "p5_menu_handler") new s_Players[32], i_Num, i_Player new s_Name[64], s_Player[10] get_players(s_Players, i_Num) for (new i; i < i_Num; i++) { i_Player = s_Players[i] get_user_name(i_Player, s_Name, charsmax(s_Name)) num_to_str(i_Player, s_Player, charsmax(s_Player)) if(is_user_alive(i_Player)) format(s_Name, charsmax(s_Name), "\w%s", s_Name) else format(s_Name, charsmax(s_Name), "\d%s", s_Name) menu_additem(menu, s_Name, s_Player, 0) } menu_setprop(menu, MPROP_NEXTNAME, "Далее") menu_setprop(menu, MPROP_BACKNAME, "Назад") menu_setprop(menu, MPROP_EXITNAME, "Выход") menu_display(id, menu, 0) } public p5_menu_handler(id, menu, item) { if (item == MENU_EXIT) { //cmdautom(id) menu_destroy(menu) return PLUGIN_HANDLED } new s_Data[6], s_Name[64], i_Access, i_Callback menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback) new i_Player = str_to_num(s_Data) if(is_user_connected(i_Player) && is_user_alive(i_Player)) { switch(givingweapon[id]) { case 21: { cs_set_user_bpammo(i_Player, givingweapon[id], 32) give_item(i_Player, "weapon_m3") } case 5: { cs_set_user_bpammo(i_Player, givingweapon[id], 32) give_item(i_Player, "weapon_xm1014") } case 7: { cs_set_user_bpammo(i_Player, givingweapon[id], 100) give_item(i_Player, "weapon_mac10") } case 23: { cs_set_user_bpammo(i_Player, givingweapon[id], 120) give_item(i_Player, "weapon_tmp") } case 19: { cs_set_user_bpammo(i_Player, givingweapon[id], 120) give_item(i_Player, "weapon_mp5navy") } case 12: { cs_set_user_bpammo(i_Player, givingweapon[id], 100) give_item(i_Player, "weapon_ump45") } case 30: { cs_set_user_bpammo(i_Player, givingweapon[id], 100) give_item(i_Player, "weapon_p90") } } } cmdgiveautom(id, givingweapon[id]) menu_destroy(menu) return PLUGIN_HANDLED } public cmdrifles(id) { new menu = menu_create("\rВыберите оружие", "r_menu_handler") menu_additem(menu, "M4A1", "1") menu_additem(menu, "AK47", "2") menu_additem(menu, "AWP", "3") menu_additem(menu, "AUG", "4") menu_additem(menu, "SG552", "5") menu_additem(menu, "Famas", "6") menu_additem(menu, "Galil", "7") menu_additem(menu, "Scout", "8") menu_setprop(menu, MPROP_NEXTNAME, "Далее") menu_setprop(menu, MPROP_BACKNAME, "Назад") menu_setprop(menu, MPROP_EXITNAME, "Выход") menu_display(id, menu, 0) } public r_menu_handler(id, menu, item) { if (item == MENU_EXIT) { //cmdmenu(id) menu_destroy(menu) return PLUGIN_HANDLED } new s_Data[6], s_Name[64], i_Access, i_Callback menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback) new Key = str_to_num(s_Data) switch(Key) { case 1: cmdgiverifle(id, 22, 0) case 2: cmdgiverifle(id, 28, 0) case 3: cmdgiverifle(id, 18, 0) case 4: cmdgiverifle(id, 8, 0) case 5: cmdgiverifle(id, 27, 0) case 6: cmdgiverifle(id, 15, 0) case 7: cmdgiverifle(id, 14, 0) case 8: cmdgiverifle(id, 3, 0) } menu_destroy(menu) return PLUGIN_HANDLED } public cmdgiverifle(id, weapon, pack) { givingweapon[id] = weapon givepack[id] = pack new menu = menu_create("Выберите игрока", "p_menu_handler") new s_Players[32], i_Num, i_Player new s_Name[64], s_Player[10] get_players(s_Players, i_Num) for (new i; i < i_Num; i++) { i_Player = s_Players[i] get_user_name(i_Player, s_Name, charsmax(s_Name)) num_to_str(i_Player, s_Player, charsmax(s_Player)) if(is_user_alive(i_Player)) format(s_Name, charsmax(s_Name), "\w%s", s_Name) else format(s_Name, charsmax(s_Name), "\d%s", s_Name) menu_additem(menu, s_Name, s_Player, 0) } menu_setprop(menu, MPROP_NEXTNAME, "Далее") menu_setprop(menu, MPROP_BACKNAME, "Назад") menu_setprop(menu, MPROP_EXITNAME, "Выход") menu_display(id, menu, 0) } public p_menu_handler(id, menu, item) { if (item == MENU_EXIT) { /*if(givepack[id]) cmdpack(id) else cmdrifles(id)*/ menu_destroy(menu) return PLUGIN_HANDLED } new s_Data[6], s_Name[64], i_Access, i_Callback menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback) new i_Player = str_to_num(s_Data) if(is_user_connected(i_Player) && is_user_alive(i_Player)) { cs_set_user_bpammo(i_Player, givingweapon[id], 90) switch(givingweapon[id]) { case 22: give_item(i_Player, "weapon_m4a1") case 28: give_item(i_Player, "weapon_ak47") case 18: give_item(i_Player, "weapon_awp") case 8: give_item(i_Player, "weapon_aug") case 27: give_item(i_Player, "weapon_sg552") case 15: give_item(i_Player, "weapon_famas") case 14: give_item(i_Player, "weapon_galil") case 3: give_item(i_Player, "weapon_scout") case 24: give_item(i_Player, "weapon_g3sg1") case 13: give_item(i_Player, "weapon_sg550") } if(givepack[id]) { give_item(i_Player, "weapon_flashbang") give_item(i_Player, "weapon_flashbang") give_item(i_Player, "weapon_hegrenade") give_item(i_Player, "weapon_smokegrenade") if(cs_get_user_team(i_Player) == CS_TEAM_CT) cs_set_user_defuse(i_Player, 1) cs_set_user_armor(i_Player, 100, CsArmorType:2) cs_set_user_bpammo(i_Player, CSW_DEAGLE, 35) give_item(id, "weapon_deagle") } } cmdgiverifle(id, givingweapon[id], givepack[id]) menu_destroy(menu) return PLUGIN_HANDLED } public cmdsecond(id) { new menu = menu_create("\rВыберите предмет", "se_menu_handler") menu_additem(menu, "Кусачки", "1") menu_additem(menu, "Все гранаты", "2") menu_additem(menu, "Бронежилет", "3") menu_setprop(menu, MPROP_EXITNAME, "Выход") menu_display(id, menu, 0) } public se_menu_handler(id, menu, item) { if (item == MENU_EXIT) { //cmdmenu(id) menu_destroy(menu) return PLUGIN_HANDLED } new s_Data[6], s_Name[64], i_Access, i_Callback menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback) new Key = str_to_num(s_Data) switch(Key) { case 1: cmdgivesec(id, 1) case 2: cmdgivesec(id, 2) case 3: cmdgivesec(id, 3) case 4: cmdgivesec(id, 4) } menu_destroy(menu) return PLUGIN_HANDLED } public cmdgivesec(id, item) { givingweapon[id] = item new menu = menu_create("Выберите игрока", "p3_menu_handler") new s_Players[32], i_Num, i_Player new s_Name[64], s_Player[10] get_players(s_Players, i_Num) for (new i; i < i_Num; i++) { i_Player = s_Players[i] get_user_name(i_Player, s_Name, charsmax(s_Name)) num_to_str(i_Player, s_Player, charsmax(s_Player)) if(is_user_alive(i_Player)) format(s_Name, charsmax(s_Name), "\w%s", s_Name) else format(s_Name, charsmax(s_Name), "\d%s", s_Name) menu_additem(menu, s_Name, s_Player, 0) } menu_setprop(menu, MPROP_NEXTNAME, "Далее") menu_setprop(menu, MPROP_BACKNAME, "Назад") menu_setprop(menu, MPROP_EXITNAME, "Выход") menu_display(id, menu, 0) } public p3_menu_handler(id, menu, item) { if (item == MENU_EXIT) { //cmdsecond(id) menu_destroy(menu) return PLUGIN_HANDLED } new s_Data[6], s_Name[64], i_Access, i_Callback menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback) new i_Player = str_to_num(s_Data) if(is_user_connected(i_Player) && is_user_alive(i_Player)) { switch(givingweapon[id]) { case 1: cs_set_user_defuse(i_Player, 1) case 2: { give_item(i_Player, "weapon_flashbang") give_item(i_Player, "weapon_flashbang") give_item(i_Player, "weapon_hegrenade") give_item(i_Player, "weapon_smokegrenade") } case 3: cs_set_user_armor(i_Player, 100, CsArmorType:2) } } cmdgivesec(id, givingweapon[id]) menu_destroy(menu) return PLUGIN_HANDLED } public cmdpack(id) { new menu = menu_create("\rВыберите оружие", "pa_menu_handler") menu_additem(menu, "M4A1 + Pack", "1") menu_additem(menu, "AK47 + Pack", "2") menu_additem(menu, "AWP + Pack", "3") menu_additem(menu, "AUG + Pack", "4") menu_additem(menu, "SG552 + Pack", "5") menu_additem(menu, "Famas + Pack", "6") menu_additem(menu, "Galil + Pack", "7") menu_additem(menu, "Scout + Pack", "8") //menu_additem(menu, "G3SG1 + Pack", "9") // menu_additem(menu, "SG550 + Pack", "10") menu_setprop(menu, MPROP_NEXTNAME, "Далее") menu_setprop(menu, MPROP_BACKNAME, "Назад") menu_setprop(menu, MPROP_EXITNAME, "Выход") menu_display(id, menu, 0) } public pa_menu_handler(id, menu, item) { if (item == MENU_EXIT) { //cmdmenu(id) menu_destroy(menu) return PLUGIN_HANDLED } new s_Data[6], s_Name[64], i_Access, i_Callback menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback) new Key = str_to_num(s_Data) switch(Key) { case 1: cmdgiverifle(id, 22, 1) case 2: cmdgiverifle(id, 28, 1) case 3: cmdgiverifle(id, 18, 1) case 4: cmdgiverifle(id, 8, 1) case 5: cmdgiverifle(id, 27, 1) case 6: cmdgiverifle(id, 15, 1) case 7: cmdgiverifle(id, 14, 1) case 8: cmdgiverifle(id, 3, 1) //case 9: cmdgiverifle(id, 24, 1) //case 10: cmdgiverifle(id, 13, 1) } menu_destroy(menu) return PLUGIN_HANDLED }