#define TE_EXPLOSION 3 #define TE_EXPLFLAG_NONE 0 #define TE_SMOKE 5 #define TE_BLOODSPRITE 115 #define TE_BLOODSTREAM 101 #define TE_MODEL 106 #define TE_WORLDDECAL 116 #define SEQ_IDLE 0 #define SEQ_FIDGET 1 #define SEQ_RELOAD 2 #define SEQ_FIRE 3 #define BA_AMMO 3 #define BA_DMGRAD 250 // NOTE: damagradius is not affected by walls #define BA_MAXDMG 150 #define BA_RLDTM 2.0 // in seconds #define BA_TRLTM 30 // roughly 3 seconds #define BA_VELCT 700 // custom velocity //this function is more internal than external, it makes giving a bazooka happen in one line instead of 15 public give_item_bazooka(id,ammo,sound){ hasBazooka[id] = true // the plugin now knows they have a bazooka Munni[id] = ammo //set ammunition CanShoot[id] = true // they can shoot now if(mode[id]==1){ mode[id]=2; } check_model(id); // refresh model if(sound){ //audio notification emit_sound(id, CHAN_ITEM, "items/gunpickup2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) } set_task(0.1,"forceslot3",id+3482); } public forceslot3(id){ id-=3482; if(!IsPlayer(id) || !is_user_alive(id))return PLUGIN_CONTINUE; client_cmd(id,"slot3"); check_model(id); bazooka_showmodename(id); ammo_hud(id, 0) ammo_hud(id, 1) // refresh hud info return PLUGIN_CONTINUE; } //this replaces the dropped bomb model with the rpg model public forward_setmodel(entity , model[]) { if(!is_valid_ent(entity)){ return FMRES_IGNORED; } new id=pev(entity,pev_owner); if(IsPlayer(id) && is_user_alive(id) && equali(model, "models/w_knife.mdl") && hasBazooka[id] && mode[id]!=1){ entity_set_model(entity , "models/w_rpg.mdl"); return FMRES_SUPERCEDE; } return FMRES_IGNORED; } public player_bazooka(id){ new attack = get_user_button(id) & IN_ATTACK new oldattack = get_user_oldbutton(id) & IN_ATTACK new attack2 = get_user_button(id) & IN_ATTACK2 new oldattack2 = get_user_oldbutton(id) & IN_ATTACK2 new reload = get_user_button(id) & IN_RELOAD new oldreload = get_user_oldbutton(id) & IN_RELOAD if (attack && !oldattack && mode[id]!=1) { if(CanShoot[id] && (user_controll[id]==0)){ fire_rocket(id); } } else if((reload && !oldreload) || (attack2 && !oldattack2 && mode[id]!=1)){ check_model(id) switch(mode[id]){ case 1: { mode[id] = 2 ammo_hud(id, 0) ammo_hud(id, 1) check_model(id) emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) client_print(id, print_center, "Bazooka") set_animation(id,SEQ_FIDGET); } case 2: { mode[id] = 3 ammo_hud(id, 0) ammo_hud(id, 1) check_model(id) emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) emit_sound(id, CHAN_WEAPON, "items/nvg_on.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) client_print(id, print_center, "Bazooka samonaprowadzajaca") set_animation(id,SEQ_FIDGET); } case 3: { mode[id] = 1 ammo_hud(id, 0) ammo_hud(id, 1) check_model(id) emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) emit_sound(id, CHAN_WEAPON, "items/gunpickup4.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) client_print(id, print_center, "Noz") set_animation(id,SEQ_FIDGET); }/* case 4: { mode[id] = 1 ammo_hud(id, 0) ammo_hud(id, 1) check_model(id) emit_sound(id, CHAN_ITEM, "common/wpn_select.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) client_print(id, print_center, "Bazooka sterowana przez gracza") set_animation(id,SEQ_FIDGET); }*/ } } else if(mode[id]!=1){ return FMRES_SUPERCEDE; } return FMRES_IGNORED; } public bazooka_showmodename(id){ switch(mode[id]){ case 1: client_print(id, print_center, "Noz"); case 2: client_print(id, print_center, "Bazooka"); case 3: client_print(id, print_center, "Bazooka samonaprowadzajaca"); case 4: client_print(id, print_center, "Bazooka sterowana przez gracza"); } } //this gets rid of the backpack model for bomb carriers, i left it in for reference /*public forward_setmodel(entity, model[]) { if (!is_valid_ent(entity)) { return FMRES_IGNORED } if (equal(model, "models/w_backpack.mdl")) { client_print(0, print_center, "") new ClassName[32] entity_get_string(entity, EV_SZ_classname, ClassName, 31) if (equal(ClassName, "weaponbox")) { remove_entity(entity) return FMRES_SUPERCEDE } } return FMRES_IGNORED }*/ /*Notes: Around here i was trying to make the rpg animations work seq_animation[id] sets the animation sequence for a specific id the animation numbers for the bazooka are listed as constants at the top and are as follows: SEQ_IDLE 0 SEQ_FIDGET 1 SEQ_RELOAD 2 SEQ_FIRE 3 i don't remember how well i got animations to work, but i remember that at best, you had to be holding the fire button for the fire animation to work */ public rpg_reloaddone(data[]) { new id=data[0]; CanShoot[id]=true; set_animation(id,SEQ_IDLE); } public fire_rocket(id){ ammo_hud(id, 0) ammo_hud(id, 1) //those two functions above effectively refresh the custom hud info for the bazooka CanShoot[id] = false set_animation(id,SEQ_FIRE); new data[1] data[0] = id //Note: since rtime must be a float i made the cvar a whole number for convienence //but then i added 0.0 to make it a float for later set_task(BA_RLDTM, "rpg_reloaddone", id+9477, data, 1) //when can i shoot again? set_animation(id, SEQ_RELOAD); if (Munni[id] <= 0) { //no ammo, do empty click emit_sound(id, CHAN_WEAPON, "weapons/dryfire1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) return PLUGIN_HANDLED; } else { //ammo, start up the math //don't touch most of this unless you know your vectors and ents new Float:StartOrigin[3], Float:Angle[3] new PlayerOrigin[3] get_user_origin(id, PlayerOrigin, 1) StartOrigin[0] = float(PlayerOrigin[0]) StartOrigin[1] = float(PlayerOrigin[1]) StartOrigin[2] = float(PlayerOrigin[2]) entity_get_vector(id, EV_VEC_v_angle, Angle) Angle[0] = Angle[0] * -1.0 new RocketEnt = create_entity("info_target") entity_set_string(RocketEnt, EV_SZ_classname, "rpgrocket") entity_set_model(RocketEnt, "models/rpgrocket.mdl") entity_set_origin(RocketEnt, StartOrigin) entity_set_vector(RocketEnt, EV_VEC_angles, Angle) new Float:MinBox[3] = {-1.0, -1.0, -1.0} new Float:MaxBox[3] = {1.0, 1.0, 1.0} entity_set_vector(RocketEnt, EV_VEC_mins, MinBox) entity_set_vector(RocketEnt, EV_VEC_maxs, MaxBox) entity_set_int(RocketEnt, EV_INT_solid, 2) entity_set_int(RocketEnt, EV_INT_movetype, 5) entity_set_edict(RocketEnt, EV_ENT_owner, id) new Float:Velocity[3] new myvelocity = BA_VELCT //custom velocity VelocityByAim(id, myvelocity, Velocity) entity_set_vector(RocketEnt, EV_VEC_velocity, Velocity) emit_sound(RocketEnt, CHAN_WEAPON, "weapons/rocketfire1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) emit_sound(RocketEnt, CHAN_VOICE, "weapons/nuke_fly.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) ammo_hud(id, 0) Munni[id]-- if(Munni[id]<=0){ hasBazooka[id]=false; emit_sound(id, CHAN_WEAPON, "weapons/dryfire1.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM) check_model(id); ammo_hud(id, 0); client_cmd(id,"slot3; slot2; slot1"); } ammo_hud(id, 1) //here we do the trail colors new CsTeams:iTeam =cs_get_user_team(id) new trailtime =BA_TRLTM switch(iTeam) { case CS_TEAM_T: { //if team T color=red message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(22) write_short(RocketEnt) write_short(rocketsmoke) write_byte(trailtime) write_byte(3) write_byte(255) write_byte(0) write_byte(0) write_byte(255) message_end() } case CS_TEAM_CT: { // if team CT color=blue message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(22) write_short(RocketEnt) write_short(rocketsmoke) write_byte(trailtime) write_byte(3) write_byte(0) write_byte(0) write_byte(255) write_byte(255) message_end() } } if (mode[id] == 3) { //mmmmm heat-seeking new info[1] info[0] = RocketEnt set_task(1.0, "find_and_follow", 0, info, 1) } else if (mode[id] == 4) { //user-guided entity_set_int(RocketEnt, EV_INT_rendermode, 1) attach_view(id, RocketEnt) wb_setview(id, RocketEnt) user_controll[id] = RocketEnt } return PLUGIN_HANDLED } return PLUGIN_HANDLED } public find_and_follow(info[]) { new RocketEnt = info[0] new Float:shortestDist = 10000.0 new nearestPlayer = 0 if (is_valid_ent(RocketEnt)) { new players[32], count get_players(players, count) for (new i = 0; i < count; i++) { if (is_user_alive(players[i]) && (entity_get_edict(RocketEnt, EV_ENT_owner) != players[i]) && (get_user_team(players[i]) != get_user_team(entity_get_edict(RocketEnt, EV_ENT_owner)))) { new Float:PlayerOrigin[3], Float:RocketOrigin[3] entity_get_vector(players[i], EV_VEC_origin, PlayerOrigin) entity_get_vector(RocketEnt, EV_VEC_origin, RocketOrigin) new Float:distance = vector_distance(PlayerOrigin, RocketOrigin) if (distance <= shortestDist) { shortestDist = distance nearestPlayer = players[i] } } } } if (nearestPlayer > 0) { new data[2] data[0] = RocketEnt data[1] = nearestPlayer set_task(0.1, "follow_and_catch", RocketEnt, data, 2, "b") } else { pfn_touch(RocketEnt, 0) } } public follow_and_catch(data[]) { new RocketEnt = data[0] new target = data[1] new myvelocity = BA_VELCT if (is_user_alive(target) && is_valid_ent(RocketEnt)) { entity_set_follow(RocketEnt, target, (myvelocity+0.0)) new Float:Velocity[3] new Float:NewAngle[3] entity_get_vector(RocketEnt, EV_VEC_velocity, Velocity) vector_to_angle(Velocity, NewAngle) entity_set_vector(RocketEnt, EV_VEC_angles, NewAngle) } else { remove_task(RocketEnt) new info[1] info[0] = RocketEnt set_task(0.1, "find_and_follow", 0, data, 1) } } public pfn_touch(ptr, ptd){ new ClassName[32] new ClassNameptd[32] //here i grab the classname of each item for debugging and advanced collisions later if ((ptr > 0) && is_valid_ent(ptr)) { entity_get_string(ptr, EV_SZ_classname, ClassName, 31) } if ((ptd > 0) && is_valid_ent(ptd)) { entity_get_string(ptd, EV_SZ_classname, ClassNameptd, 31) } if (equal(ClassName, "rpgrocket")) { remove_task(ptr) new Float:EndOrigin[3]//x,y,z entity_get_vector(ptr, EV_VEC_origin, EndOrigin) message_begin( MSG_BROADCAST, SVC_TEMPENTITY) // Explosion write_byte(TE_EXPLOSION) write_coord(floatround(EndOrigin[0])) write_coord(floatround(EndOrigin[1])) write_coord(floatround(EndOrigin[2])+5) write_short(g_sModelIndexFireball) write_byte(random_num(0,20) + 20) write_byte(12) // framerate write_byte(TE_EXPLFLAG_NONE) message_end() message_begin(MSG_BROADCAST, SVC_TEMPENTITY) // Smoke write_byte(TE_SMOKE) write_coord(floatround(EndOrigin[0])) write_coord(floatround(EndOrigin[1])) write_coord(floatround(EndOrigin[2])+15) write_short(g_sModelIndexSmoke) write_byte(60) write_byte(10) message_end() /*message_begin(MSG_BROADCAST,SVC_TEMPENTITY) // Explosion Decal write_byte(28) //grenade explotion mark write_coord(floatround(EndOrigin[0])) write_coord(floatround(EndOrigin[1])) write_coord(floatround(EndOrigin[2])) write_short(spr_blood_spray) write_short(spr_blood_drop) write_byte(229) // color index write_byte(15) // size message_end()*/ new maxdamage = BA_MAXDMG new damageradius = BA_DMGRAD if (equal(ClassNameptd, "func_breakable")) { //new Float:ptrhealth = entity_get_float(ptr,EV_FL_health); //new Float:ptdhealth = entity_get_float(ptd,EV_FL_health); //DEBUG INFO //client_print(0, print_console, "Entity ptr health is: %i",ptrhealth) //client_print(0, print_console, "Entity ptd health is: %i",ptdhealth) //entity_set_float(ptr,EV_FL_health,100.0); //i don't remember why this is here //the functions below break ANY breakables and kill the rocket //and when i say ANY breakables i mean ANY breakables //it will destroy even trigger only breakables, bad for mapmakers force_use(ptr,ptd) remove_task(ptr) } /*Notes: Here i tried to make it so that if a breakable entity was within the damage radius it would recieve it's share of damage this is very experimental as I couldn't get it to work after two or three days of tinkering */ /*if (equal(ClassNameptd, "func_breakable")) { client_print(0, print_console, "got classname %s",ClassNameptd) new Float:orig1[3], origin1[3],NonFloatEndOrigin[3] entity_get_vector(ptd, EV_VEC_origin, orig1) for(new a = 0; a < 3; a++) { origin1[a] = floatround(orig1[a]) } for(new a = 0; a < 3; a++) { NonFloatEndOrigin[a] = floatround(EndOrigin[a]) } new ptddistance = get_distance(origin1, NonFloatEndOrigin) client_print(0, print_console, "got distance %i",ptddistance) if (ptddistance <= damageradius) { client_print(0, print_console, "is in damage radius") new damage = maxdamage - floatround(floatmul(float(maxdamage), floatdiv(float(ptddistance), float(damageradius)))) if (damage > 25) { client_print(0, print_console, "damage > 25") force_use(ptr,ptd) remove_task(ptr) } else { client_print(0, print_console, "damage < 25") remove_task(ptr) } } return PLUGIN_CONTINUE }*/ new PlayerPos[3], distance, damage for (new i = 1; i < 32; i++) { if (is_user_alive(i) == 1) { get_user_origin(i, PlayerPos) new NonFloatEndOrigin[3] for(new a = 0; a < 3; a++) { NonFloatEndOrigin[a] = floatround(EndOrigin[a]) } distance = get_distance(PlayerPos, NonFloatEndOrigin) if (distance <= damageradius) { // Screenshake Radius message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenShake"), {0,0,0}, i) // Shake Screen write_short(1<<14) write_short(1<<14) write_short(1<<14) message_end() damage = maxdamage - floatround(floatmul(float(maxdamage), floatdiv(float(distance), float(damageradius)))) new attacker = entity_get_edict(ptr, EV_ENT_owner) if (!get_user_godmode(i)) { if (get_user_team(attacker) != get_user_team(i)) { if (damage < get_user_health(i)) { set_user_health(i, get_user_health(i) - damage) } else { set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET) user_kill(i, 1) set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT) message_begin(MSG_BROADCAST, get_user_msgid("DeathMsg")) // Kill-Log oben rechts write_byte(attacker) // Attacker write_byte(i) // Victim write_byte(0) // Headshot write_string("bazooka") message_end() if (damage > 100) { //begin gibs and effects (made by mike_cao) new iOrigin[3] get_user_origin(i,iOrigin) // Effects fx_trans(i,0) fx_gib_explode(iOrigin,3) fx_blood_large(iOrigin,5) fx_blood_small(iOrigin,15) iOrigin[2] = iOrigin[2]-20 // Hide body set_user_origin(i,iOrigin) } //end gibs and effects set_user_frags(attacker, get_user_frags(attacker) + 1) } } if (get_user_team(attacker) == get_user_team(i)) { if (attacker == i) { if (damage < get_user_health(i)) { set_user_health(i, get_user_health(i) - damage) } else { set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET) user_kill(i, 1) set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT) message_begin(MSG_BROADCAST, get_user_msgid("DeathMsg")) // Kill-Log oben rechts write_byte(attacker) // Attacker write_byte(i) // Victim write_byte(0) // Headshot write_string("bazooka") message_end() if ((damage > 100)) { //begin gibs and effects (made by mike_cao) new iOrigin[3] get_user_origin(i,iOrigin)// Effects fx_trans(i,0) fx_gib_explode(iOrigin,3) fx_blood_large(iOrigin,5) fx_blood_small(iOrigin,15) iOrigin[2] = iOrigin[2]-20 // Hide body set_user_origin(i,iOrigin) } //end gibs and effects set_user_frags(attacker, get_user_frags(attacker) - 1) } } else { if (get_cvar_num("mp_friendlyfire")) { if (damage < get_user_health(i)) { set_user_health(i, get_user_health(i) - damage) } else { set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET) user_kill(i, 1) set_msg_block(get_user_msgid("DeathMsg"), BLOCK_NOT) message_begin(MSG_BROADCAST, get_user_msgid("DeathMsg")) // Kill-Log oben rechts write_byte(attacker) // Attacker write_byte(i) // Victim write_byte(0) // Headshot write_string("bazooka") message_end() if (damage > 100) { //begin gibs and effects (made by mike_cao) new iOrigin[3] get_user_origin(i,iOrigin)// Effects fx_trans(i,0) fx_gib_explode(iOrigin,3) fx_blood_large(iOrigin,5) fx_blood_small(iOrigin,15) iOrigin[2] = iOrigin[2]-20 // Hide body set_user_origin(i,iOrigin) } //end gibs and effects set_user_frags(attacker, get_user_frags(attacker) - 1) } } } } } } } } attach_view(entity_get_edict(ptr, EV_ENT_owner), entity_get_edict(ptr, EV_ENT_owner)) user_controll[entity_get_edict(ptr, EV_ENT_owner)] = 0 remove_entity(ptr) } if (equal(ClassName, "rpg") || equal(ClassName, "rpg_temp")) { new Picker[32] if ((ptd > 0) && is_valid_ent(ptd)) { entity_get_string(ptd, EV_SZ_classname, Picker, 31) } if (equal(Picker, "player")) { give_item_bazooka(ptd,(Munni[ptd] + entity_get_int(ptr, EV_INT_iuser1)),1) remove_entity(ptr) } } return PLUGIN_CONTINUE } /*Notes: DON'T SCREW WITH THE MODES. PERIOD! It took me hours to figure out the logic for each action and make it work. the modes as they are allow only one player at a time to access the c4 and will also force a player to move to the next mode if the one they are on is restricted which can happen if the admin changes restrictions during gameplay */ /*Notes in version 1.3c this function spawned both an rpg and a bomb upon dropping the bazooka, in version 1.3d i cleaned it up and hopefully fixed this error ...i think i only cleaned it up, will test later... */ public drop_rpg_temp(id){ new Float:PlayerOrigin[3], Float:End[3], Float:Return[3], Float:TraceDirection[3], Float:Angles[3] entity_get_vector(id, EV_VEC_origin, PlayerOrigin) entity_get_vector(id, EV_VEC_angles, Angles) VelocityByAim(id, 200, TraceDirection) End[0] = TraceDirection[0] + PlayerOrigin[0] End[1] = TraceDirection[1] + PlayerOrigin[1] End[2] = TraceDirection[2] + PlayerOrigin[2] trace_line(id, PlayerOrigin, End, Return) Return[2] = PlayerOrigin[2] new RPG = create_entity("info_target") entity_set_string(RPG, EV_SZ_classname, "rpg_temp") entity_set_model(RPG, "models/w_rpg.mdl") entity_set_origin(RPG, Return) Angles[0] = 0.0 Angles[2] = 0.0 entity_set_vector(RPG, EV_VEC_angles, Angles) new Float:MinBox[3] = {-16.0, -16.0, 0.0} new Float:MaxBox[3] = {16.0, 16.0, 16.0} entity_set_vector(RPG, EV_VEC_mins, MinBox) entity_set_vector(RPG, EV_VEC_maxs, MaxBox) entity_set_int(RPG, EV_INT_solid, 1) entity_set_int(RPG, EV_INT_movetype, 6) entity_set_int(RPG, EV_INT_iuser1, Munni[id]) Munni[id] = 0 hasBazooka[id] = false return PLUGIN_HANDLED } /*Notes: This function is highly experimental too It should allow the use of seq_animation[id] in place of the "anim" parameter to set the current animation of a specific player. The trick is getting the animation to cycle through the frames and not stay on the first one in each animation */ stock set_animation(id, anim){ set_pev(id, pev_weaponanim, anim) message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, id) write_byte(anim) write_byte(pev(id, pev_body)) message_end() } //Yay custom hud! ammo_hud(id, show) { new AmmoHud[65],text[20] if (mode[id] == 1) { format(AmmoHud, 64, ""); } else if (mode[id] == 2) { text = "Normalny"; } else if (mode[id] == 3) { text = "Samonaprowadzajacy"; } else if (mode[id] == 4) { text = "Sterowany"; } if(mode[id]!=1) format(AmmoHud, 64, "Bazooka | Rakiety: %i | Tryb: %s", Munni[id],text); if(show){ message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("StatusText"), {0,0,0}, id) write_byte(0) write_string(AmmoHud) message_end() } else { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("StatusText"), {0,0,0}, id) write_byte(0) write_string("") message_end() } } /*Notes: I've seen this work on my computer 100% of the time, but i've not been able to test it online or with multiple players what this funtion does is check to see if the player has the bazooka weapon out and then it changes the model accordingly, but if that weapon is not out then it changes back to what it should be */ public check_model(id){ new weaponid, clip, ammo; weaponid = get_user_weapon(id, clip, ammo) if ((weaponid == CSW_KNIFE) && hasBazooka[id] && (mode[id] != 1)){ ammo_hud(id, 0) ammo_hud(id, 1) entity_set_string(id, EV_SZ_viewmodel, "models/v_rpg.mdl") entity_set_string(id, EV_SZ_weaponmodel, "models/p_rpg.mdl") } else if (weaponid == CSW_KNIFE){ ammo_hud(id, 0) entity_set_string(id, EV_SZ_viewmodel, "models/v_knife.mdl") entity_set_string(id, EV_SZ_weaponmodel, "models/p_knife.mdl") } else if (weaponid != CSW_KNIFE){ ammo_hud(id, 0) } return PLUGIN_HANDLED; } static fx_trans(player,amount) { set_user_rendering(player,kRenderFxNone,0,0,0,kRenderTransAlpha,amount) return PLUGIN_CONTINUE } static fx_blood_small(origin[3],num) { // Blood decals static const blood_small[7] = {190,191,192,193,194,195,197} // Small splash for (new j = 0; j < num; j++) { message_begin(MSG_BROADCAST,SVC_TEMPENTITY) write_byte(TE_WORLDDECAL) write_coord(origin[0]+random_num(-100,100)) write_coord(origin[1]+random_num(-100,100)) write_coord(origin[2]-36) write_byte(blood_small[random_num(0,6)]) // index message_end() } } static fx_blood_large(origin[3],num) { // Blood decals static const blood_large[2] = {204,205} // Large splash for (new i = 0; i < num; i++) { message_begin(MSG_BROADCAST,SVC_TEMPENTITY) write_byte(TE_WORLDDECAL) write_coord(origin[0]+random_num(-50,50)) write_coord(origin[1]+random_num(-50,50)) write_coord(origin[2]-36) write_byte(blood_large[random_num(0,1)]) // index message_end() } } static fx_gib_explode(origin[3],num) { new flesh[3], x, y, z flesh[0] = mdl_gib_flesh flesh[1] = mdl_gib_meat flesh[2] = mdl_gib_legbone // Gib explosion // Head message_begin(MSG_BROADCAST,SVC_TEMPENTITY) write_byte(TE_MODEL) write_coord(origin[0]) write_coord(origin[1]) write_coord(origin[2]) write_coord(random_num(-100,100)) write_coord(random_num(-100,100)) write_coord(random_num(100,200)) write_angle(random_num(0,360)) write_short(mdl_gib_head) write_byte(0) // bounce write_byte(500) // life message_end() // Spine message_begin(MSG_BROADCAST,SVC_TEMPENTITY) write_byte(TE_MODEL) write_coord(origin[0]) write_coord(origin[1]) write_coord(origin[2]) write_coord(random_num(-100,100)) write_coord(random_num(-100,100)) write_coord(random_num(100,200)) write_angle(random_num(0,360)) write_short(mdl_gib_spine) write_byte(0) // bounce write_byte(500) // life message_end() // Lung for(new i = 0; i < random_num(1,2); i++) { message_begin(MSG_BROADCAST,SVC_TEMPENTITY) write_byte(TE_MODEL) write_coord(origin[0]) write_coord(origin[1]) write_coord(origin[2]) write_coord(random_num(-100,100)) write_coord(random_num(-100,100)) write_coord(random_num(100,200)) write_angle(random_num(0,360)) write_short(mdl_gib_lung) write_byte(0) // bounce write_byte(500) // life message_end() } // Parts, 10 times for(new i = 0; i < 10; i++) { message_begin(MSG_BROADCAST,SVC_TEMPENTITY) write_byte(TE_MODEL) write_coord(origin[0]) write_coord(origin[1]) write_coord(origin[2]) write_coord(random_num(-100,100)) write_coord(random_num(-100,100)) write_coord(random_num(100,200)) write_angle(random_num(0,360)) write_short(flesh[random_num(0,2)]) write_byte(0) // bounce write_byte(500) // life message_end() } // Blood for(new i = 0; i < num; i++) { x = random_num(-100,100) y = random_num(-100,100) z = random_num(0,100) for(new j = 0; j < 3; j++) { message_begin(MSG_BROADCAST,SVC_TEMPENTITY) write_byte(TE_BLOODSPRITE) write_coord(origin[0]+(x*j)) write_coord(origin[1]+(y*j)) write_coord(origin[2]+(z*j)) write_short(spr_blood_spray) write_short(spr_blood_drop) write_byte(229) // color index write_byte(15) // size message_end() } } } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\ rtf1\ ansi\ deff0{\ fonttbl{\ f0\ fnil Tahoma;}}n\ viewkind4\ uc1\ pard\ lang1045\ f0\ fs16 n\ par } */