Witam,
Mam oto taki public
public cod_class_skill_used(id)
{
if(is_user_alive(id))
{
new origin[3]
new Float: Origin[3], Float: vAngle[3], Float: Velocity[3];
new velocity[3]
get_user_origin(id, origin, 1)
new Float: minBound[3] = {-50.0, -50.0, 0.0} //sets the minimum bound of entity
new Float: maxBound[3] = {50.0, 50.0, 0.0} //sets the maximum bound of entity
IVecFVec(origin, Origin)
new Float:viewing_angles[3]
new distance_from_user = 70
entity_get_vector(id, EV_VEC_angles, viewing_angles)
Origin[0] += floatcos(viewing_angles[1], degrees) * distance_from_user
Origin[1] += floatsin(viewing_angles[1], degrees) * distance_from_user
Origin[2] += floatsin(-viewing_angles[0], degrees) * distance_from_user
new Ent = create_entity("info_target");
entity_set_string(Ent, EV_SZ_classname, "disk");
entity_set_model(Ent, "models/weedcs_cod/kosmita_dysk.mdl")
velocity_by_aim(id, 700, Velocity)
FVecIVec(Velocity, velocity) //converts a floating vector to an integer vector
vAngle[0] *= -1.0;
entity_set_origin(Ent, Origin);
entity_set_vector(Ent, EV_VEC_velocity, Velocity)
entity_set_size(Ent, minBound, maxBound);
entity_set_int(Ent,EV_INT_movetype, MOVETYPE_NOCLIP)
entity_set_int(Ent, EV_INT_solid, SOLID_TRIGGER)
entity_set_edict(Ent, EV_ENT_owner, id);
emit_sound(Ent, CHAN_VOICE, "weedcs_cod/kosmita.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(22) //TE_BEAMFOLLOW
write_short(Ent) //The entity to attach the sprite to
write_short(flash) //sprite's model
write_byte(5) //life in 0.1 seconds
write_byte(50) //width of sprite
write_byte(255) //red
write_byte(0) //green
write_byte(255) //blue
write_byte(255) //brightness
message_end()
}
return;
}
Chciałbym aby Ent który jest tworzony, poruszał się tam gdzie celuje celownik a nie po linii prostej. Jakieś sugestie?
P.S Dodam że kod zaciągnięty z SuperHero Mod, postać Frieza (sma w załączniku)
Załączone pliki
Użytkownik oeN. edytował ten post 09.02.2015 19:11


Dodatki SourceMod




sh_frieza.amxx









