Witajcie. Prosiłbym o modyfikację dwóch perków o nazwach: "Cichacz" i "Predator". Chciałbym, aby te perki miały takie same moce, jak napisane w opisie. Prawie wszystko jest łatwe i już zrobione, lecz problem polega na tym, iż nie wyrzuca broni, które gracz posiada. Kody w spoilerach, a sma w załączniku.
Cichacz:
Spoiler
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <fun> #include <codmod> #define DMG_BULLET (1<<1) new const perk_name[] = "Cichacz"; new const perk_desc[] = "Jestes niewidoczny, masz 1 hp"; new bool:ma_perk[33]; public plugin_init() { register_plugin(perk_name, "1.0", "QTM_Peyote"); cod_register_perk(perk_name, perk_desc); register_event("ResetHUD", "ResetHUD", "abe"); } public cod_perk_enabled(id) { cod_give_weapon(id, CSW_USP); cod_take_weapon(id, CSW_P228); cod_take_weapon(id, CSW_SCOUT); cod_take_weapon(id, CSW_XM1014); cod_take_weapon(id, CSW_MAC10); cod_take_weapon(id, CSW_AUG); cod_take_weapon(id, CSW_ELITE); cod_take_weapon(id, CSW_FIVESEVEN); cod_take_weapon(id, CSW_UMP45); cod_take_weapon(id, CSW_SG550); cod_take_weapon(id, CSW_GALI); cod_take_weapon(id, CSW_FAMAS); cod_take_weapon(id, CSW_GLOCK18); cod_take_weapon(id, CSW_AWP); cod_take_weapon(id, CSW_MP5NAVY); cod_take_weapon(id, CSW_M249); cod_take_weapon(id, CSW_M3); cod_take_weapon(id, CSW_M4A1); cod_take_weapon(id, CSW_TMP); cod_take_weapon(id, CSW_G3SG1); cod_take_weapon(id, CSW_DEAGLE); cod_take_weapon(id, CSW_SG552); cod_take_weapon(id, CSW_AK47); cod_take_weapon(id, CSW_P90); ma_perk[id] = true; } public cod_perk_disabled(id) { set_user_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 255); ma_perk[id] = false; } public ResetHUD(id) { if(ma_perk[id]) set_task(0.5, "UstawStalker", id) } public UstawStalker(id) { if(is_user_connected(id)) { set_user_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 1); set_user_health(id, 1); } }
Predator:
Spoiler
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <fakemeta> #include <codmod> #include <hamsandwich> #include <colorchat> #include <fun> #define DMG_BULLET (1<<1) new const perk_name[] = "Predator"; new const perk_desc[] = "Dostajesz 600HP, widzisz niewidzialnych oraz 1/1 z kosy (PPM)"; new bool:ma_perk[33]; public plugin_init() { register_plugin(perk_name, "1.0", "QTM_Peyote"); cod_register_perk(perk_name, perk_desc); register_forward(FM_AddToFullPack, "FwdAddToFullPack", 1) RegisterHam(Ham_TakeDamage, "player", "TakeDamage"); register_event("ResetHUD", "ResetHUD", "abe"); } public cod_perk_enabled(id) { cod_take_weapon(id, CSW_USP); cod_take_weapon(id, CSW_P228); cod_take_weapon(id, CSW_SCOUT); cod_take_weapon(id, CSW_XM1014); cod_take_weapon(id, CSW_MAC10); cod_take_weapon(id, CSW_AUG); cod_take_weapon(id, CSW_ELITE); cod_take_weapon(id, CSW_FIVESEVEN); cod_take_weapon(id, CSW_UMP45); cod_take_weapon(id, CSW_SG550); cod_take_weapon(id, CSW_GALI); cod_take_weapon(id, CSW_FAMAS); cod_take_weapon(id, CSW_GLOCK18); cod_take_weapon(id, CSW_AWP); cod_take_weapon(id, CSW_MP5NAVY); cod_take_weapon(id, CSW_M249); cod_take_weapon(id, CSW_M3); cod_take_weapon(id, CSW_M4A1); cod_take_weapon(id, CSW_TMP); cod_take_weapon(id, CSW_G3SG1); cod_take_weapon(id, CSW_DEAGLE); cod_take_weapon(id, CSW_SG552); cod_take_weapon(id, CSW_AK47); cod_take_weapon(id, CSW_P90); ma_perk[id] = true; ColorChat(id, GREEN, "Perk %s zostal stworzony przez QuatZo"); return COD_CONTINUE; } public cod_perk_disabled(id) ma_perk[id] = false; public FwdAddToFullPack(es_handle, e, ent, host, hostflags, player, pSet) { if(!is_user_connected(host) || !is_user_connected(ent)) return; if(!ma_perk[host]) return; set_es(es_handle, ES_RenderAmt, 255.0); } public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits) { if(!is_user_connected(idattacker)) return HAM_IGNORED; if(!ma_perk[idattacker]) return HAM_IGNORED; if(get_user_weapon(idattacker) == CSW_KNIFE && damagebits & DMG_BULLET && damage > 20.0) cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits); return HAM_IGNORED; } public ResetHUD(id) { if(ma_perk[id]) set_task(0.5, "UstawStalker", id) } public UstawStalker(id) { if(is_user_connected(id)) { set_user_health(id, 600); } }
Oczywiście, każda pomoc zostanie wynagrodzona.
Załączone pliki
-
codperk_cichacz.sma 1,62 KB 11 Ilość pobrań
codperk_cichacz.amxx -
codperk_predator.sma 2,43 KB 13 Ilość pobrań
codperk_predator.amxx
Użytkownik QuatZo edytował ten post 01.09.2013 14:58