RSSy MYGO.pl Opublikowano Listopad 13, 2021 o 18:01 RSSy Udostępnij Opublikowano Listopad 13, 2021 o 18:01 Hi, I would like the other weapons to disappear when I choose my weapon. Now if I choose a weapon and receive revive, I have that one too and I can choose another one and so on. I dont want that. I hope u understand. PHP Code: #include <amxmodx> #include <cstrike> #include <fakemeta> #include <hamsandwich> #include <fun> new const PLUGIN[] = "Furien Weapons"; new const VERSION[] = "1.0"; new const AUTHOR[] = "*BoOoM*"; #pragma semicolon 1 #define VIP_FLAG ADMIN_LEVEL_H new const ArmaGold1Model[66] = "models/v_m4a1_gold.mdl"; new const ArmaGold2Model[66] = "models/v_ak47_gold.mdl"; new const ArmaGold3Model[66] = "models/v_mp5_gold.mdl"; new const ArmaGold4Model[66] = "models/v_xm1014_gold.mdl"; new const ArmaGold5Model[66] = "models/v_m3_gold.mdl"; new bool: Arma1[33]; new bool: Arma2[33]; new bool: Arma3[33]; new bool: Arma4[33]; new bool: Arma5[33]; new bool: ArmaGold1[33]; new bool: ArmaGold2[33]; new bool: ArmaGold3[33]; new bool: ArmaGold4[33]; new bool: ArmaGold5[33]; new bool: ArmaChoosen[33]; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_clcmd("say /weapons","SayArme"); register_clcmd("say /guns","SayArme"); register_event("CurWeapon", "CurentWeapon", "be", "1=1"); RegisterHam(Ham_Spawn, "player", "Spawn", 1); RegisterHam(Ham_TakeDamage, "player", "DamageArme"); } public Spawn(id) { if(is_user_alive(id)) { give_item(id, "weapon_knife"); give_item(id, "weapon_deagle"); cs_set_user_bpammo ( id, CSW_DEAGLE, 999); ArmaChoosen[id] = false; Arma1[id] = false; Arma2[id] = false; Arma3[id] = false; Arma4[id] = false; Arma5[id] = false; ArmaGold1[id] = false; ArmaGold2[id] = false; ArmaGold3[id] = false; ArmaGold4[id] = false; ArmaGold5[id] = false; if(cs_get_user_team(id) == CS_TEAM_CT) { MenuArme(id); } } } public plugin_precache() { precache_model(ArmaGold1Model); precache_model(ArmaGold2Model); precache_model(ArmaGold3Model); precache_model(ArmaGold4Model); precache_model(ArmaGold5Model); } public client_disconnect(id) { ArmaGold1[id] = false; ArmaGold2[id] = false; ArmaGold3[id] = false; ArmaGold4[id] = false; ArmaGold5[id] = false; } public MenuArme(id) { new menu = menu_create ("\rNume\w.\yNume\w.\rRo \yWeapons \rMenu", "CaseMenu"); menu_additem(menu, "\rArme \yPlayeri", "1"); menu_additem(menu, "\rArme \yV\w.\yI\w.\yP", "2"); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0 ); return 1; } public CaseMenu(id, menu, item) { if(item == MENU_EXIT) { return 1; } new data [6], szName [64]; new access, callback; menu_item_getinfo (menu, item, access, data,charsmax (data), szName,charsmax (szName), callback); new key = str_to_num (data); switch (key) { case 1: { { MenuPlayeri(id); } } case 2: { if( get_user_flags( id ) & VIP_FLAG ) { MenuVIP(id); } else { ChatColor(id, "!g[BB]!nAceste arme pot fi luate doar de membri !gVIP"); MenuArme(id); } } } menu_destroy (menu); return 1; } public MenuPlayeri(id) { new menu = menu_create ("\rBaseBuilder \yWeapons Menu", "CaseArmePlayeri"); menu_additem(menu, "\yM4A1", "1"); menu_additem(menu, "\yAk47", "2"); menu_additem(menu, "\yMP5", "3"); menu_additem(menu, "\yXM1014", "4"); menu_additem(menu, "\yM3", "5"); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0 ); return 1; } public CaseArmePlayeri(id, menu, item) { if(item == MENU_EXIT) { return 1; } if(!is_user_alive(id)) { ChatColor(id, "!g[BB] !nNu-ti poti alege arma atunci când esti mort"); return 1; } new data [6], szName [64]; new access, callback; menu_item_getinfo (menu, item, access, data,charsmax (data), szName,charsmax (szName), callback); new key = str_to_num (data); switch (key) { case 1: { ArmaChoosen[id] = true; Arma1[id] = true; set_task(0.2, "GiveWeapon", id); CurentWeapon(id); ChatColor(id, "!g[BB] !nAi ales !gM4A1"); } case 2: { ArmaChoosen[id] = true; Arma2[id] = true; set_task(0.2, "GiveWeapon", id); CurentWeapon(id); ChatColor(id, "!g[BB] !nAi ales !gAk47"); } case 3: { ArmaChoosen[id] = true; Arma3[id] = true; set_task(0.2, "GiveWeapon", id); CurentWeapon(id); ChatColor(id, "!g[BB] !nAi ales !gMP5"); } case 4: { ArmaChoosen[id] = true; Arma4[id] = true; set_task(0.2, "GiveWeapon", id); CurentWeapon(id); ChatColor(id, "!g[BB] !nAi ales !gXM1014"); } case 5: { ArmaChoosen[id] = true; Arma5[id] = true; set_task(0.2, "GiveWeapon", id); CurentWeapon(id); ChatColor(id, "!g[BB] !nAi ales !gM3"); } } menu_destroy (menu); return 1; } public MenuVIP(id) { new menu = menu_create ("\rFurien VIP \yWeapons Menu", "CaseArmeVIP"); menu_additem(menu, "\yGolden \rM4A1", "1"); menu_additem(menu, "\yGolden \rAk47", "2"); menu_additem(menu, "\yGolden \rMP5", "3"); menu_additem(menu, "\yGolden \rXM1014", "4"); menu_additem(menu, "\yGolden \rM3", "5"); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0 ); return 1; } public CaseArmeVIP(id, menu, item) { if(item == MENU_EXIT) { return 1; } if(!is_user_alive(id)) { ChatColor(id, "!g[BB] !nNu-ti poti alege arma atunci când esti mort"); return 1; } new data [6], szName [64]; new access, callback; menu_item_getinfo (menu, item, access, data,charsmax (data), szName,charsmax (szName), callback); new key = str_to_num (data); switch (key) { case 1: { ArmaChoosen[id] = true; ArmaGold1[id] = true; set_task(0.2, "GiveWeapon", id); CurentWeapon(id); ChatColor(id, "!g[BB] !nAi ales !gM4A1 Gold"); } case 2: { ArmaChoosen[id] = true; ArmaGold2[id] = true; set_task(0.2, "GiveWeapon", id); CurentWeapon(id); ChatColor(id, "!g[BB] !nAi ales !gAk47 Gold"); } case 3: { ArmaChoosen[id] = true; ArmaGold3[id] = true; set_task(0.2, "GiveWeapon", id); CurentWeapon(id); ChatColor(id, "!g[BB] !nAi ales !gMP5 Gold"); } case 4: { ArmaChoosen[id] = true; ArmaGold4[id] = true; set_task(0.2, "GiveWeapon", id); CurentWeapon(id); ChatColor(id, "!g[BB] !nAi ales !gXM1014 Gold"); } case 5: { ArmaChoosen[id] = true; ArmaGold5[id] = true; set_task(0.2, "GiveWeapon", id); CurentWeapon(id); ChatColor(id, "!g[BB] !nAi ales !gM34 Gold"); } } menu_destroy (menu); return 1; } public GiveWeapon(id) { if(Arma1[id]) { give_item(id, "weapon_m4a1"); cs_set_user_bpammo(id, CSW_M4A1, 250); } if(Arma2[id]) { give_item(id, "weapon_ak47"); cs_set_user_bpammo(id, CSW_AK47, 250); } if(Arma3[id]) { give_item(id, "weapon_mp5navy"); cs_set_user_bpammo(id, CSW_MP5NAVY, 250); } if(Arma4[id]) { give_item(id, "weapon_xm1014"); cs_set_user_bpammo(id, CSW_XM1014, 250); } if(Arma5[id]) { give_item(id, "weapon_m3"); cs_set_user_bpammo(id, CSW_M3, 250); } if(ArmaGold1[id]) { give_item(id, "weapon_m4a1"); cs_set_user_bpammo(id, CSW_M4A1, 250); } if(ArmaGold2[id]) { give_item(id, "weapon_ak47"); cs_set_user_bpammo(id, CSW_AK47, 250); } if(ArmaGold3[id]) { give_item(id, "weapon_mp5navy"); cs_set_user_bpammo(id, CSW_MP5NAVY, 250); } if(ArmaGold4[id]) { give_item(id, "weapon_xm1014"); cs_set_user_bpammo(id, CSW_XM1014, 250); } if(ArmaGold5[id]) { give_item(id, "weapon_m3"); cs_set_user_bpammo(id, CSW_M3, 250); } } public CurentWeapon(id) { if(ArmaGold1[id] && get_user_weapon(id) == CSW_M4A1 ) set_pev(id, pev_viewmodel2, ArmaGold1Model); if(ArmaGold2[id] && get_user_weapon(id) == CSW_AK47 ) set_pev(id, pev_viewmodel2, ArmaGold2Model); if(ArmaGold3[id] && get_user_weapon(id) == CSW_MP5NAVY ) set_pev(id, pev_viewmodel2, ArmaGold3Model); if(ArmaGold4[id] && get_user_weapon(id) == CSW_XM1014 ) set_pev(id, pev_viewmodel2, ArmaGold4Model); if(ArmaGold5[id] && get_user_weapon(id) == CSW_M3 ) set_pev(id, pev_viewmodel2, ArmaGold5Model); } public DamageArme (iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits) { if(iInflictor == iAttacker && ArmaGold1[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_M4A1 && cs_get_user_team(iAttacker) == CS_TEAM_CT) { SetHamParamFloat(4, fDamage * 2.0); return HAM_HANDLED; } if(iInflictor == iAttacker && ArmaGold2[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_AK47 && cs_get_user_team(iAttacker) == CS_TEAM_CT) { SetHamParamFloat(4, fDamage * 2.0); return HAM_HANDLED; } if(iInflictor == iAttacker && ArmaGold3[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_MP5NAVY && cs_get_user_team(iAttacker) == CS_TEAM_CT) { SetHamParamFloat(4, fDamage * 2.0); return HAM_HANDLED; } if(iInflictor == iAttacker && ArmaGold4[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_XM1014 && cs_get_user_team(iAttacker) == CS_TEAM_CT) { SetHamParamFloat(4, fDamage * 1.3); return HAM_HANDLED; } if(iInflictor == iAttacker && ArmaGold5[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_M3 && cs_get_user_team(iAttacker) == CS_TEAM_CT) { SetHamParamFloat(4, fDamage * 1.2); return HAM_HANDLED; } return HAM_IGNORED; } public SayArme(id) { if(ArmaChoosen[id]) { ChatColor(id, "!g[BB] !nAi ales deja o arma în aceasta runda"); return; } if(cs_get_user_team(id) == CS_TEAM_CT) { MenuArme(id); } } stock ChatColor( const id, const input[ ], any:... ) { new msg[191], players[32], count = 1; vformat(msg,charsmax(msg),input,3); replace_all(msg,charsmax(msg),"!g","^4"); replace_all(msg,charsmax(msg),"!n","^1"); replace_all(msg,charsmax(msg),"!t","^3"); 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(); } } } Przeczytaj cały wpis Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi