Co tu jest źle ? Dlaczego wybuch nie zadaje obrażeń ?
public CmdStart(id, uc_handle)
{
new weapon = get_user_weapon(id);
if(!is_user_alive(id))
return PLUGIN_CONTINUE;
if(weapon == 1 && ma_bron[id])
{
if(!ma_klase[id])
return FMRES_IGNORED
if(!bfg10k_ammo[id] && (pev(id, pev_oldbuttons) & IN_ATTACK))
{
client_print(id, print_center, "Brak Amunicji");
return PLUGIN_CONTINUE;
}
new Button = get_uc(uc_handle, UC_Buttons)
new OldButton = pev(id, pev_oldbuttons)
new ent = fm_find_ent_by_owner(-1, "weapon_p228", id);
if(Button & IN_ATTACK && !(OldButton & IN_ATTACK) && bfg_shooting[id] == NONE)
{
Button &= ~IN_ATTACK;
set_uc(uc_handle, UC_Buttons, Button);
if(!bfg10k_ammo[id] || !idle[id])
return FMRES_IGNORED;
if(idle[id] && (get_gametime()-idle[id]<=0.7))
return FMRES_IGNORED;
set_pev(id, pev_weaponanim, 1);
emit_sound(id, CHAN_WEAPON, "weapons/displacer_fire.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
bfg_shooting[id] = SHOOTING
set_task(0.8, "MakeMattery", id+MAKE_MATTERY)
return FMRES_IGNORED
}
if(Button & IN_RELOAD)
{
Button &= ~IN_RELOAD;
set_uc(uc_handle, UC_Buttons, Button);
set_pev(id, pev_weaponanim, 0);
set_pdata_float(id, 83, 0.5, 4);
if(ent)
set_pdata_float(ent, 48, 0.5+3.0, 4);
}
if(ent)
cs_set_weapon_ammo(ent, -1);
cs_set_user_bpammo(id, 1, bfg10k_ammo[id]);
}
else if(weapon != 1 && ma_bron[id])
idle[id] = 0.0;
return FMRES_IGNORED
}
public MakeMattery(id)
{
id-=MAKE_MATTERY
bfg_shooting[id] = SHOOTED
bfg10k_ammo[id]--
new Float: Origin[3], Float: vAngle[3], Float: Velocity[3];
entity_get_vector(id, EV_VEC_v_angle, vAngle);
entity_get_vector(id, EV_VEC_origin , Origin);
set_pev(id, pev_weaponanim, 1);
new ent = create_entity("info_target");
entity_set_string(ent, EV_SZ_classname, "Displacer");
entity_set_model(ent, "models/QTM_CodMod/displacer_mattery.mdl");
fm_set_user_rendering(ent, kRenderFxGlowShell, 0, 255, 0, kRenderNormal, 255)
vAngle[0] *= -1.0;
entity_set_origin(ent, Origin);
entity_set_vector(ent, EV_VEC_angles, vAngle);
entity_set_int(ent, EV_INT_effects, 2);
entity_set_int(ent, EV_INT_solid, SOLID_BBOX);
entity_set_int(ent, EV_INT_movetype, MOVETYPE_FLY);
entity_set_edict(ent, EV_ENT_owner, id);
VelocityByAim(id, 400 , Velocity);
entity_set_vector(ent, EV_VEC_velocity ,Velocity);
entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.1);
}
public DotykWiazki(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);
write_byte(20);
write_byte(0);
message_end();
new entlist[33];
new numfound = find_sphere_class(ent, "player", 165.0, entlist, 32);
for (new i=0; i {
new pid = entlist[i];
if (!is_user_alive(pid) || get_user_team(attacker) == get_user_team(pid) || !(pev(ent, pev_flags) & FL_ONGROUND))
continue;
cod_inflict_damage(attacker, pid, 100.0, 0.3, ent, (1<<24));
}
remove_entity(ent);
bfg_shooting[attacker] = NONE
}

Użytkownik **Tomeczek** edytował ten post 04.07.2018 21:04