MATPAC Дата: Воскресенье, 2013-09-15, 00:30 | Сообщение # 16
Сообщений: 266
Цитата (sez )
Ребят, а может не работает потому, что движок hl1 не читает mp3? Или я, все-таки, ошибаюсь и возможности amx позволяют воспроизводить mp3?
Я же говорю Цитата (MATPAC )
Плагин работает с другой Mp3 музыкой
Добавлено (2013-09-15, 00:30) --------------------------------------------- Решил не создавать лишних тем и сразу написать сюда, может я уже многих задолбал Но все же, поставил на сервер плагин "new_vip.amxx " и нужно для меня немного подредактировать этот плагин Там в начале раунда даются гранаты но мне нужно, чтобы давали и броню со шлемом + в таблице TAB после имени нужна приставка "-=V.I.P=- " как тут все и заранее благодарен !!! Вот исходник:
#include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <fakemeta> #include <cstrike> #include <fun> #define PLUGIN "VIP" #define VERSION "3.5" #define AUTHOR "Extreem" #define VIP_FLAG ADMIN_LEVEL_H static const COLOR[] = "^x04" //green static const CONTACT[] = "" new maxplayers new gmsgSayText new vipsOnline new health_add new health_hs_add new health_max new nKiller new nKiller_hp new nHp_add new nHp_max new giveHp new g_awp_active //Menu Items new p_Menu_Enable, p_Give_AK47, p_Give_M4A1, p_Give_AWP new bool:HasC4[33] //Start Items new p_Start_Deagle, p_Start_He, p_Start_Flash, p_Start_Smoke, round_number, g_maxplayers, p_Plugin_Exist, p_Plugin_Exist_Time public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /vip", "vipinfo") register_dictionary("viplang.txt") new configsDir[64] get_configsdir(configsDir, 63) server_cmd("exec %s/vip_config.cfg", configsDir) register_event("CurWeapon", "event_CurWeapon", "be", "1=1") register_clcmd("awp","HandleCmd") g_awp_active = register_cvar("awp_only_vips", "1") giveHp = register_cvar("give_kill_hp", "1") health_add = register_cvar("kill_hp", "5") health_hs_add = register_cvar("kill_hs_hp", "10") health_max = register_cvar("max_hp", "100") register_event("DeathMsg", "hook_death", "a", "1>0") p_Menu_Enable = register_cvar("menu_enable", "1") p_Give_AK47 = register_cvar("menu_ak47", "1") p_Give_M4A1 = register_cvar("menu_m4a1", "1") p_Give_AWP = register_cvar("menu_awp", "1") p_Start_Deagle = register_cvar("start_deagle", "1") p_Start_He = register_cvar("start_hegrenade", "1") p_Start_Flash = register_cvar("start_flash", "2") p_Start_Smoke = register_cvar("start_smokegrenade","1") p_Plugin_Exist = register_cvar("plugin_exist", "1") p_Plugin_Exist_Time = register_cvar("plugin_exist_time", "60.0") vipsOnline = register_cvar("show_vips", "1") RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1); register_event("HLTV", "event_round_start", "a", "1=0", "2=0") register_event("TextMsg", "event_game_restart", "a", "2=#Game_Commencing", "2=#Game_will_restart_in") g_maxplayers=get_maxplayers() maxplayers = get_maxplayers() register_clcmd("say", "handle_say") register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER) gmsgSayText = get_user_msgid("SayText") } 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") replace_all(msg,190,"!y","^1") replace_all(msg,190,"!team","^3") replace_all(msg, 190,"!team2","^0") 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() } } } } public HandleCmd(id){ if (get_pcvar_num(g_awp_active) == 1) return PLUGIN_CONTINUE if(!(get_user_flags(id) & VIP_FLAG)) return PLUGIN_CONTINUE client_print(id, print_center, "%L", LANG_SERVER, "AWP_ONLY_FOR_VIP") return PLUGIN_HANDLED } public event_CurWeapon(id){ if (get_pcvar_num(g_awp_active) == 1){ if(read_data(2) == CSW_AWP){ if(!(get_user_flags(id) & VIP_FLAG)){ client_print(id, print_center, "%L", LANG_SERVER, "AWP_ONLY_FOR_VIP") client_cmd(id, "drop") } } } return PLUGIN_HANDLED } public hook_death() { if(get_pcvar_num(giveHp) == 1){ nKiller = read_data(1) if(!access(nKiller,VIP_FLAG)) return; if ( (read_data(3) == 1) && (read_data(5) == 0) ) { nHp_add = get_pcvar_num (health_hs_add) } else nHp_add = get_pcvar_num (health_add) nHp_max = get_pcvar_num (health_max) nKiller_hp = get_user_health(nKiller) nKiller_hp += nHp_add if (nKiller_hp > nHp_max) nKiller_hp = nHp_max set_user_health(nKiller, nKiller_hp) set_hudmessage(0, 255, 0, -1.0, 0.15, 0, 1.0, 1.0, 0.1, 0.1, -1) show_hudmessage(nKiller, "%L", LANG_SERVER, "HP_ADD", nHp_add) } } public mymenu(id){ new MyMenu=menu_create("Player Menu","vipMenu"); new MyMenuFun=menu_makecallback("mcbMyMenu"); new m4a1[150] formatex(m4a1, sizeof m4a1 - 1, "%L", id, "MENU_M4A1") menu_additem(MyMenu,m4a1,"",0,MyMenuFun); new ak47[150] formatex(ak47, sizeof ak47 - 1, "%L", id, "MENU_AK47") menu_additem(MyMenu,ak47 ,"",0,MyMenuFun); new awp[150] formatex(awp, sizeof awp - 1, "%L", id, "MENU_AWP") menu_additem(MyMenu,awp,"",0,MyMenuFun); if(get_user_flags(id) & VIP_FLAG){ menu_display(id, MyMenu,0); } else{ ChatColor(id,"%L",LANG_SERVER,"NOT_VIP") } return PLUGIN_HANDLED; } public vipMenu(id, menu, item){ switch(item){ case 0:{ if (user_has_weapon(id, CSW_C4)){ HasC4[id] = true; } else{ HasC4[id] = false; } strip_user_weapons (id) give_item(id, "weapon_m4a1") cs_set_user_bpammo(id, CSW_M4A1, 90) give_item(id,"weapon_knife") if(get_pcvar_num(p_Start_He) == 1){ give_item(id,"weapon_hegrenade") } if(get_pcvar_num(p_Start_Flash) == 1){ give_item(id, "weapon_flashbang"); } else if(get_pcvar_num(p_Start_Flash) == 2){ give_item(id, "weapon_flashbang"); give_item(id, "weapon_flashbang"); } if(get_pcvar_num(p_Start_Smoke) == 1){ give_item(id, "weapon_smokegrenade"); } if(get_pcvar_num(p_Start_Deagle) == 1){ give_item(id,"weapon_deagle") cs_set_user_bpammo(id, CSW_DEAGLE, 35) } else if(cs_get_user_team(id) == CS_TEAM_CT){ give_item(id, "weapon_usp") cs_set_user_bpammo(id, CSW_USP, 24) } else if (cs_get_user_team(id) == CS_TEAM_T){ give_item(id, "weapon_glock18") cs_set_user_bpammo(id, CSW_GLOCK18, 40) } give_item(id, "weapon_smokegrenade"); give_item(id, "item_assaultsuit"); give_item(id, "item_thighpack"); if (HasC4[id]){ give_item(id, "weapon_c4"); cs_set_user_plant( id ); } ChatColor(id,"%L",LANG_SERVER,"GET_WEAPON_M4A1") } case 1:{ if (user_has_weapon(id, CSW_C4)){ HasC4[id] = true; } else{ HasC4[id] = false; } strip_user_weapons (id) give_item(id, "weapon_ak47") cs_set_user_bpammo(id, CSW_AK47, 90) give_item(id,"weapon_knife") if(get_pcvar_num(p_Start_He) == 1){ give_item(id,"weapon_hegrenade") } if(get_pcvar_num(p_Start_Flash) == 1){ give_item(id, "weapon_flashbang"); } else if(get_pcvar_num(p_Start_Flash) == 2){ give_item(id, "weapon_flashbang"); give_item(id, "weapon_flashbang"); } if(get_pcvar_num(p_Start_Smoke) == 1){ give_item(id, "weapon_smokegrenade"); } if(get_pcvar_num(p_Start_Deagle) == 1){ give_item(id,"weapon_deagle") cs_set_user_bpammo(id, CSW_DEAGLE, 35) } else if(cs_get_user_team(id) == CS_TEAM_CT){ give_item(id, "weapon_usp") cs_set_user_bpammo(id, CSW_USP, 24) } else if (cs_get_user_team(id) == CS_TEAM_T){ give_item(id, "weapon_glock18") cs_set_user_bpammo(id, CSW_GLOCK18, 40) } give_item(id, "weapon_smokegrenade"); give_item(id, "item_assaultsuit"); give_item(id, "item_thighpack"); if (HasC4[id]){ give_item(id, "weapon_c4"); cs_set_user_plant( id ); } ChatColor(id,"%L",LANG_SERVER,"GET_WEAPON_AK47") } case 2:{ if (user_has_weapon(id, CSW_C4)){ HasC4[id] = true; } else{ HasC4[id] = false; } strip_user_weapons (id) give_item(id, "weapon_awp") cs_set_user_bpammo(id, CSW_AWP, 30) give_item(id,"weapon_knife") if(get_pcvar_num(p_Start_He) == 1){ give_item(id,"weapon_hegrenade") } if(get_pcvar_num(p_Start_Flash) == 1){ give_item(id, "weapon_flashbang"); } else if(get_pcvar_num(p_Start_Flash) == 2){ give_item(id, "weapon_flashbang"); give_item(id, "weapon_flashbang"); } if(get_pcvar_num(p_Start_Smoke) == 1){ give_item(id, "weapon_smokegrenade"); } if(get_pcvar_num(p_Start_Deagle) == 1){ give_item(id,"weapon_deagle") cs_set_user_bpammo(id, CSW_DEAGLE, 35) } else if(cs_get_user_team(id) == CS_TEAM_CT){ give_item(id, "weapon_usp") cs_set_user_bpammo(id, CSW_USP, 24) } else if (cs_get_user_team(id) == CS_TEAM_T){ give_item(id, "weapon_glock18") cs_set_user_bpammo(id, CSW_GLOCK18, 40) } give_item(id, "weapon_smokegrenade"); give_item(id, "item_assaultsuit"); give_item(id, "item_thighpack") if (HasC4[id]){ give_item(id, "weapon_c4"); cs_set_user_plant( id ); } ChatColor(id,"%L",LANG_SERVER,"GET_WEAPON_AWP") } } } public mcbMyMenu(id, menu, item){ if(item==0){ if(get_pcvar_num(p_Give_M4A1) != 1){ return ITEM_DISABLED; } } if(item==1){ if(get_pcvar_num(p_Give_AK47) != 1){ return ITEM_DISABLED; } } if(item==2){ if(get_pcvar_num(p_Give_AWP) != 1){ return ITEM_DISABLED; } } return ITEM_ENABLED; } public event_round_start() { if(get_pcvar_num(p_Menu_Enable) == 1){ round_number++ if (round_number>1) { for (new id=1;id<=g_maxplayers;id++) { if (!is_user_connected(id)||is_user_bot(id)) continue if(get_user_flags(id) & VIP_FLAG){ if(cs_get_user_team(id) == CS_TEAM_CT || CS_TEAM_T){ set_task(0.1, "mymenu", id, _, _, "a", 1) } } } } } } public event_game_restart() { round_number=0 } public fwHamPlayerSpawnPost(id){ if (get_user_flags(id) & VIP_FLAG) { strip_user_weapons (id) give_item(id,"weapon_knife") if(get_pcvar_num(p_Start_Deagle) == 1){ give_item(id,"weapon_deagle") cs_set_user_bpammo(id, CSW_DEAGLE, 35) } else if(cs_get_user_team(id) == CS_TEAM_CT){ give_item(id, "weapon_usp") cs_set_user_bpammo(id, CSW_USP, 24) } else if (cs_get_user_team(id) == CS_TEAM_T){ give_item(id, "weapon_glock18") cs_set_user_bpammo(id, CSW_GLOCK18, 40) } if(get_pcvar_num(p_Start_He) == 1){ give_item(id, "weapon_hegrenade") } if(get_pcvar_num(p_Start_Flash) == 1){ give_item(id, "weapon_flashbang") } else if(get_pcvar_num(p_Start_Flash) == 2){ give_item(id, "weapon_flashbang") give_item(id, "weapon_flashbang") } if(get_pcvar_num(p_Start_Smoke) == 1){ give_item(id, "weapon_smokegrenade") } } } public vipinfo(id){ show_motd(id, "vipinfo.txt") } public client_authorized(id) { if(get_pcvar_num(p_Plugin_Exist) == 1){ set_task(get_pcvar_float(p_Plugin_Exist_Time), "vipInfoMessage", id, _, _, "b") } } public vipInfoMessage(id) { if(!is_user_admin(id)) ChatColor(id,"%L",LANG_SERVER,"INFO_VIP_PLUGIN_EXIST") } public handle_say(id) { new said[192] read_args(said,192) if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vips") != -1 ) set_task(0.1,"print_adminlist",id) return PLUGIN_CONTINUE } public print_adminlist(user) { if(get_pcvar_num(vipsOnline) == 1){ new adminnames[33][32] new message[256] new contactinfo[256], contact[112] new id, count, x, len for(id = 1 ; id <= maxplayers ; id++) if(is_user_connected(id)) if(get_user_flags(id) & VIP_FLAG) get_user_name(id, adminnames[count++], 31) len = format(message, 255, "%s VIP Online: ",COLOR) if(count > 0) { for(x = 0 ; x < count ; x++) { len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"") if(len > 96 ) { print_message(user, message) len = format(message, 255, "%s ",COLOR) } } print_message(user, message) } else { len += format(message[len], 255-len, "%L", LANG_SERVER,"NO_VIPS_ONLLINE") print_message(user, message) } get_cvar_string("amx_contactinfo", contact, 63) if(contact[0]) { format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact) print_message(user, contactinfo) } } } print_message(id, msg[]) { message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id) write_byte(id) write_string(msg) message_end() } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1029\\ f0\\ fs16 \n\\ par } */
Файл исходник ССЫЛКА
В конце, концов и наконец, найдешь ты конец наконец...
Сообщение отредактировал MATPAC - Воскресенье, 2013-09-15, 00:35