Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- register_touch("mortar", "*" , "DodirRakete");
- public Nade_Touch(ent)
- {
- if(!pev_valid(ent))
- return FMRES_IGNORED
- new attacker = pev(ent, pev_owner);
- new Float:entOrigin[3], Float:fDamage, Float:Origin[3];
- pev(ent, pev_origin, entOrigin);
- entOrigin[2] += 1.0;
- new Float:xm320_damage = get_pcvar_float(PCvarDamage);
- new Float:xm320_radius = get_pcvar_float(PCvarRadius);
- new entlist[33];
- new numfound = find_sphere_class(ent, "player", xm320_radius, entlist, 32);
- for (new i=0; i < numfound; i++)
- {
- new pid = entlist[i];
- if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid))
- continue;
- ExecuteHam(Ham_TakeDamage, pid, ent, attacker, float(xm320_damage)) , 1);
- }
- emit_sound(ent, CHAN_WEAPON, XM320_EXPLO, 1.0, ATTN_NORM, 0, PITCH_NORM)
- message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
- write_byte(TE_EXPLOSION);
- write_coord(floatround(entOrigin[0]));
- write_coord(floatround(entOrigin[1]));
- write_coord(floatround(entOrigin[2]));
- write_short(explo);
- write_byte(40);
- write_byte(30);
- write_byte(14);
- message_end();
- message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
- write_byte(TE_EXPLOSION);
- write_coord(floatround(entOrigin[0]));
- write_coord(floatround(entOrigin[1]));
- write_coord(floatround(entOrigin[2]));
- write_short(blast);
- write_byte(40);
- write_byte(30);
- write_byte(TE_EXPLFLAG_NONE);
- message_end();
- message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
- write_byte(5)
- write_coord(floatround(entOrigin[0]));
- write_coord(floatround(entOrigin[1]));
- write_coord(floatround(entOrigin[2]));
- write_short(smoke);
- write_byte(35);
- write_byte(5);
- message_end();
- remove_entity(ent);
- return FMRES_IGNORED
- }
- public DodirRakete(ent)
- {
- if ( !is_valid_ent(ent))
- return;
- new attacker = entity_get_edict(ent, EV_ENT_owner);
- new Float:fOrigin[3];
- entity_get_vector(ent, EV_VEC_origin, fOrigin);
- new iOrigin[3];
- for(new i=0;i<3;i++)
- iOrigin[i] = floatround(fOrigin[i]);
- message_begin(MSG_BROADCAST,SVC_TEMPENTITY, iOrigin);
- write_byte(TE_EXPLOSION);
- write_coord(iOrigin[0]);
- write_coord(iOrigin[1]);
- write_coord(iOrigin[2]);
- write_short(sprite_blast);
- write_byte(32); // scale
- write_byte(20); // framerate
- write_byte(0);// flags
- message_end();
- new entlist[33];
- new numfound = find_sphere_class(ent, "player", 230.0, entlist, 32);
- for (new i=0; i < numfound; i++)
- {
- new pid = entlist[i];
- if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid) || informacije_predmet_igraca[pid][0] == 24)
- continue;
- ExecuteHam(Ham_TakeDamage, pid, ent, attacker, 55.0+float(inteligencija_igraca[attacker]) , 1);
- }
- remove_entity(ent);
- }
Advertisement
Add Comment
Please, Sign In to add comment