Здравствуйте! Я хотел в virusnade сделать так, что бы использовалась не дымовая граната, а слеповая, но у меня ничего не вышло. Можете,пожалуйста, подсказать как осуществить мой замысел?
/********************************* Global Variables *********************************/
new toggle_plugin,toggle_damage,toggle_interval,toggle_intdamage, toggle_glowduration,toggle_antidot,toggle_antidotcost, toggle_glow,toggle_announce,toggle_antidotdur,toggle_antidotknife, toggle_trail,toggle_speed,toggle_touch,toggle_antidotzone;
new p_toggle,p_damage,p_int,p_dmg,p_announce,p_speed,p_glowdur,p_anticost,p_antidur; new g_msgscreenfade,g_msgstatusicon,g_msgbartime,g_msgsaytext,g_msgscoreinfo,g_msgdeathmsg; new g_Timer;
new g_trail,g_explode,g_smoke;
new bool:g_Virused[33],bool:g_Antidot[33]; new g_Count[33];
/********************************* Initialization *********************************/ public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR);
/********************************* Antidote *********************************/ public antidote_cmd(id) { // make shure the plugin is enabled if(p_toggle != 1) return PLUGIN_HANDLED;
// check if buying antidote option is enabled if(get_pcvar_num(toggle_antidot) != 1) { print(id,"You're not allowed to buy an antidote!"); return PLUGIN_HANDLED; }
// make shure the player is alive if(!is_user_alive(id)) { print(id,"You must be alive to buy an antidote!"); return PLUGIN_HANDLED; }
// check if is in buyzone if(!cs_get_user_buyzone(id) && get_pcvar_num(toggle_antidotzone) == 1) { print(id,"You must be in Buyzone to buy an antidote!"); return PLUGIN_CONTINUE; }
// make shure he has enough money new money = cs_get_user_money(id); if(money < p_anticost) { print(id,"Not enough money, you need $%d to buy an antidote!",p_anticost); center(id,"#Cstrike_TitlesTXT_Not_Enough_Money"); return PLUGIN_CONTINUE; }
// check if is infected if(!g_Virused[id]) { print(id,"You're not infected with the virus!"); return PLUGIN_CONTINUE; }
// check if he allready bought an antidote if(g_Antidot[id]) { print(id,"You've already bought the antidote!"); center(id,"#Cstrike_TitlesTXT_Cannot_Carry_Anymore"); return PLUGIN_HANDLED; }
g_Timer = p_antidur; g_Antidot[id] = true;
// remove flashing icon, set a normal Icon(id,1,"dmg_gas",0,255,0); set_task(1.0,"countdown",id+12345,_,_,"b"); cs_set_user_money(id,money - 1500,1); // remove money
// create a bar message_begin(MSG_ONE,g_msgbartime,_,id); write_short(p_antidur); message_end();
print(id,"You've bought an antidote for $%d !",p_anticost);
public fw_emitsound(Ent,Channel,const Sound[],Float:Volume,Float:Attenuation,Flags,Pitch) { // make shure the plugin is enabled if(p_toggle != 1) return FMRES_IGNORED; // make shure was a smokenade if(!equali(Sound,"weapons/sg_explode.wav")) return FMRES_IGNORED;
new Float:origin[3],i,name[32]; pev(Ent, pev_origin, origin); new owner = pev(Ent,pev_owner);
Light(origin); // makes a nice light effect Render(Ent,kRenderFxNone,255,255,255,15); //set the glow back to normal
while((i = fm_find_ent_in_sphere(i,origin,radius)) != 0) { if(!is_user_alive(i)) continue; // check if is allready infected if(g_Virused[i]) continue;
new Float:iorigin[3]; pev(i,pev_origin,iorigin); g_Virused[i] = true;
new hp = get_user_health(i); // check if hp is less or equal to nade damage if(hp <= p_damage) { Kill(owner,i); // kill the player
public fw_setmodel(ent,model[]) { // make shure the plugin is enabled if(p_toggle != 1) return FMRES_IGNORED; // make shure was is a smokenade if(!equali(model,"models/w_smokegrenade.mdl")) return FMRES_IGNORED; // glow nade Render(ent,kRenderFxGlowShell,0,255,0,kRenderNormal,15); if(get_pcvar_num(toggle_trail) == 1) Follow(ent,g_trail,10,5,0,255,0,175); // set the trail
public fw_prethink(id) { // make shure the plugin is enabled if(p_toggle != 1) return FMRES_IGNORED; // must be alive if(!is_user_alive(id)) return FMRES_IGNORED; // check if is infected if(!g_Virused[id]) return FMRES_IGNORED; // stop if the changing speed cvar is disabled if(p_speed != 1) return FMRES_IGNORED;
public fw_touch(touched, toucher) { // make shure the plugin is enabled if(p_toggle != 1) return FMRES_IGNORED; // make shure the touch option is enabled if(get_pcvar_num(toggle_touch) != 1) return FMRES_IGNORED;
static dclass[32],rclass[32],dname[32],rname[32];
// get class and name pev(touched, pev_classname, dclass, sizeof dclass - 1); pev(toucher, pev_classname, rclass, sizeof rclass - 1); get_user_name(touched,dname,sizeof dname - 1); get_user_name(toucher,rname,sizeof rname - 1);
// normal glow */ public glow_normal(id) Render(id,kRenderFxNone,0,0,0,kRenderNormal,255);
/********************************* Virus Descreasing Effect *********************************/ public virus(task) { new index = task-123; g_Count[index]++;
// get player's health new hp = get_user_health(index); new total = hp - p_dmg;
// get player's name new name[32]; get_user_name(index,name,31);
// anounce player death if(p_announce == 1) { set_hudmessage(0, 200, 0, 0.05, 0.25, 0, 6.0, 3.0); show_hudmessage(0, "%s was truck down by the virus!",name); } } else is_user_alive(index) ? set_pev(index,pev_health,float(total)) : remove_task(index); //remove hp
// set a death message message_begin(MSG_ALL,g_msgdeathmsg,{0,0,0},0); write_byte(killer); write_byte(victim); write_byte(0); write_string("virusnade"); message_end();
Log(killer,victim,"virusnade"); }
/* Log Kill */ Log(killer,victim,weapond[]) { new Buffer[256]; new kname[32],vname[32]; new kteam[16],vteam[16]; new kauth[32],vauth[32]; new kid,vid;
// killer info get_user_name(killer,kname,31); get_user_team(killer,kteam,15); get_user_authid(killer,kauth,31); kid = get_user_userid(killer);
// victim info get_user_name(victim,vname,31); get_user_team(victim,vteam,15); get_user_authid(victim,vauth,31); vid = get_user_userid(victim);
// teamkill message if(killer == victim) format(Buffer,255,"^"%s<%d><%s><%s>^" committed suicide with ^"%s^"",vname,vid,vteam,vauth,weapond); else format(Buffer,255,"^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^"",kname,kid,kteam,kauth,vname,vid,vteam,vauth,weapond);