vanea1 Дата: Среда, 2014-03-05, 12:46 | Сообщение # 1
Сообщений: 1
Можно ли сделать так чтобы vip игроки могли открыть команду voteban? #include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <fakemeta_util> #define VIP_FLAG ADMIN_LEVEL_H new pistols[6] = {CSW_P228, CSW_ELITE, CSW_FIVESEVEN, CSW_GALIL, CSW_USP, CSW_GLOCK18} new round_number, g_round new bool:has_used[32] public plugin_init() { register_plugin("Vip_weapon", "1.1", "7eVen") register_event("ResetHUD", "ResetHUD", "be") register_event("HLTV", "event_round_start", "a", "1=0", "2=0") register_clcmd("vipmenu", "vip_menu") register_clcmd("say /adminka", "adminka") register_clcmd("say /vipka","vipka") g_round = register_cvar("amx_vip_give", "3") } public vip_menu(id) { if ( ! ( get_user_flags ( id ) & VIP_FLAG ) ) { ChatColor ( id, "^3[^4 V.I.P^3 ] ^1 Только для ^4[V.I.P]") return PLUGIN_HANDLED; } new menu = menu_create("\r Оружейка \w[\y V.I.P \w]", "show_vipmenu") menu_additem(menu, "\wВзять \r[\y Famas \r]\r", "1") menu_additem(menu, "\wВзять \r[\y M4A1 \r]\r", "2") menu_additem(menu, "\wВзять \r[\y AK47 \r]\r", "3") menu_additem(menu, "\wВзять \r[\y AWP \r]\r", "4") menu_setprop(menu, MPROP_NEXTNAME, "Дальше") menu_setprop(menu, MPROP_BACKNAME, "Назад") menu_setprop(menu, MPROP_EXITNAME, "Выход") menu_setprop(menu, MPROP_EXIT,MEXIT_ALL) menu_display(id,menu,0) return PLUGIN_HANDLED; } public show_vipmenu(id, menu, item) { if(item == MENU_EXIT) { menu_destroy(menu) return PLUGIN_HANDLED; } if(is_user_alive(id)&& !has_used[id] ) { if ( round_number <= get_pcvar_num(g_round) ) { ChatColor ( id, "^3[^4 V.I.P^3 ] ^1 Доступно со %d раунда!", get_pcvar_num(g_round) ) return PLUGIN_HANDLED; } new data[6], iName[64], access, callback menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback) new key = str_to_num(data) switch(key) { case 1: { give_item( id, "weapon_famas" ) cs_set_user_bpammo( id , CSW_FAMAS, 90 ) } case 2: { give_item( id, "weapon_m4a1" ) cs_set_user_bpammo( id , CSW_M4A1, 90 ) } case 3: { give_item( id, "weapon_ak47" ) cs_set_user_bpammo( id , CSW_AK47, 90 ) } case 4: { give_item( id, "weapon_awp" ) cs_set_user_bpammo( id , CSW_AWP, 30 ) } } has_used[id] = true; } else { ChatColor ( id, "^3[^4 V.I.P^3 ] ^1 Вы уже использовали.Подождите..." ) return PLUGIN_HANDLED; } return PLUGIN_HANDLED; } public event_round_start () { round_number++ arrayset(has_used, false, 32) } public adminka(id) { show_motd( id, "adminka.txt", "Покупка - Админки!" ) } public vipka(id) { show_motd( id, "vip.txt", "Покупка - V.I.P!" ) } public ResetHUD(id) { set_task(0.5, "VIP", id + 6910) } public VIP(TaskID) { new id = TaskID - 6910 if (get_user_flags(id) & VIP_FLAG && is_user_connected(id) && is_user_alive(id)) { for (new i = 0; i < 6; i++) { if (fm_strip_user_gun(id, pistols[i])) { break; } message_begin(MSG_ALL, get_user_msgid("ScoreAttrib")) write_byte(id) write_byte(4) message_end() give_item( id, "weapon_hegrenade" ) give_item( id, "weapon_flashbang" ) give_item( id, "weapon_flashbang" ) give_item( id, "weapon_smokegrenade" ) give_item( id, "item_assaultsuit" ) give_item( id, "item_thighpack" ) give_item( id, "weapon_deagle") give_item( id, "ammo_50ae" ) give_item( id, "ammo_50ae" ) give_item( id, "ammo_50ae" ) give_item( id, "ammo_50ae" ) give_item( id, "ammo_50ae" ) } } return PLUGIN_HANDLED; } stock ChatColor(const id, const input[], any:...) { new count = 1, players[32] static msg[191] vformat(msg, 190, input, 3) replace_all(msg, 190, "!g", "^4") // Green Color replace_all(msg, 190, "!y ", "^1") // Default Color replace_all(msg, 190, "!team", "^3") // Team Color replace_all(msg, 190, "!team2", "^0") // Team2 Color if (id) players[0] = id; else get_players(players, count, "ch") { for (new i = 0; i < count; i++) { if (is_user_connected(players[i])) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]) write_byte(players[i]); write_string(msg); message_end(); } } } }