public cod_class_skill_used(id)
{
if(!ma_klase[id])
return PLUGIN_CONTINUE
if(g_m4a1[id] == 0 || g_m203_loaded[id] == 0 || !(is_user_alive(id)))
return PLUGIN_CONTINUE
if(g_ammo[id] == 0)
{
client_print(id, print_center, "Nie masz juz granatow do M203!")
return PLUGIN_CONTINUE
}
entity_set_int(id, EV_INT_weaponanim, 3)
new Float: Origin[3], Float: Velocity[3], Float: vAngle[3], Ent
entity_get_vector(id, EV_VEC_origin , Origin)
entity_get_vector(id, EV_VEC_v_angle, vAngle)
Origin[2] = Origin[2] + 10
Ent = create_entity("info_target")
if (!Ent) return PLUGIN_HANDLED
entity_set_string(Ent, EV_SZ_classname, "m203_nade")
entity_set_model(Ent, "models/grenade.mdl")
new Float:MinBox[3] = {-1.0, -1.0, -1.0}
new Float:MaxBox[3] = {1.0, 1.0, 1.0}
entity_set_vector(Ent, EV_VEC_mins, MinBox)
entity_set_vector(Ent, EV_VEC_maxs, MaxBox)
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, 1)
entity_set_int(Ent, EV_INT_movetype, 10)
entity_set_edict(Ent, EV_ENT_owner, id)
VelocityByAim(id, 2000 , Velocity)
entity_set_vector(Ent, EV_VEC_velocity ,Velocity)
emit_sound(id,CHAN_VOICE,"misc/glauncher.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
g_m203_loaded[id] = 0
ammo_hud(id,0)
g_ammo[id]--
ammo_hud(id,1)
new parm[1]
parm[0] = Ent
parm[0] = id
set_task(2.0, "m203_reload",id+9910,parm,1)
return PLUGIN_CONTINUE
}
Powoduje ona stworzenie granatu, który sobie leeeeci i wybucha :F Problem w tym, że granat leci tylko wtedy gdy gracz stoi. Gdy biegnie granat zamiast lecieć wybucha od razu - zabijając osobę, która go wyrzuciła. Jak to wyeliminować? :F