是这个吗hy_missile
#include <amxmod>
#include <amxmisc>
#include <vexd_utilities>
#include <vexdum_stock>
new beam, boom
public plugin_init(){
register_plugin("Rocket example","0.1","Hydralisk")
register_clcmd("missile_launch","ms_launch",0,"Launch a missile")
return PLUGIN_CONTINUE
}
public plugin_precache(){
precache_model("models/rpgrocket.mdl")
beam = precache_model("sprites/laserbeam.spr")
boom = precache_model("sprites/zerogxplode.spr")
}
public ms_launch(id){
if (!is_user_alive(id)) return PLUGIN_HANDLED
new Float:Ori[3],Float:Vel[3],Float:angle[3]
entity_get_vector(id,EV_VEC_origin,Ori)
new Ent = create_entity("info_target")
entity_set_model(Ent,"models/rpgrocket.mdl")
entity_set_string(Ent,EV_SZ_classname,"hy_missile")
entity_set_edict(Ent,EV_ENT_owner,id)
entity_set_origin(Ent,Ori)
entity_set_int(Ent,EV_INT_solid,SOLID_BBOX)
entity_set_int(Ent,EV_INT_movetype,MOVETYPE_FLY)
entity_set_size(Ent,Float:{-1.0,-1.0,-1.0},Float:{1.0,1.0,1.0})
VelocityByAim(id,1500,Vel)
entity_set_vector(Ent,EV_VEC_velocity,Vel)
vector_to_angle(Vel,angle)
entity_set_vector(Ent,EV_VEC_angles,angle)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(22)
write_short(Ent)
write_short(beam)
write_byte(45)
write_byte(4)
write_byte(255)
write_byte(0)
write_byte(0)
write_byte(128)
message_end()
return PLUGIN_HANDLED
}
public entity_touch(entity1,entity2){
new sz[33]
if (is_entity(entity1)){
entity_get_string(entity1,EV_SZ_classname,sz,32)
if (equal(sz,"hy_missile")){
new Float:Ori[3],Iori[3]
entity_get_vector(entity1,EV_VEC_origin,Ori)
FVecIVec(Ori,Iori)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(3)
write_coord(Iori[0])
write_coord(Iori[1])
write_coord(Iori[2])
write_short(boom)
write_byte(50)
write_byte(15)
write_byte(0)
message_end()
radius_damage2(entity1,200.0,800.0)
remove_entity(entity1)
}
}
if (is_entity(entity2)){
entity_get_string(entity2,EV_SZ_classname,sz,32)
if (equal(sz,"hy_missile")){
new Float:Ori[3],Iori[3]
entity_get_vector(entity2,EV_VEC_origin,Ori)
FVecIVec(Ori,Iori)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(3)
write_coord(Iori[0])
write_coord(Iori[1])
write_coord(Iori[2])
write_short(boom)
write_byte(50)
write_byte(15)
write_byte(0)
message_end()
radius_damage2(entity2,200.0,800.0)
remove_entity(entity2)
}
}
}
stock radius_damage2(inf,Float:dmg,Float:rad){
new players[32],pnum,Float:rng,Float:cd,Float:ori[3],owner,cdi,health,vec[3]
new Float:pori[3]
new sz[33]
entity_get_string(inf,EV_SZ_classname,sz,32)
new team2,team1,ff = get_cvar_num("mp_friendlyfire")
entity_get_vector(inf,EV_VEC_origin,ori)
FVecIVec(ori,vec)
owner = entity_get_edict(inf,EV_ENT_owner)
team1 = get_user_team(owner)
get_players(players,pnum,"a")
for (new i=0;i<pnum;i++){
team2 = get_user_team(players)
if (team2 == team1 && !ff) continue
entity_get_vector(players,EV_VEC_origin,pori)
rng = VecDist(ori,pori)
if (rng > rad) continue
rng = rad - rng
cd = dmg / (rad*rad) * (rng * rng)
cdi = floatround(cd)
health = get_user_health(players)
health -= cdi
if (health <=0){
MessageBlock(get_user_msgid("DeathMsg"),BLOCK_ONCE)
user_kill(players,1)
entity_set_int(players,EV_INT_iuser3,owner)
message_begin(MSG_ALL,get_user_msgid("DeathMsg"))
write_byte(owner)
write_byte(players)
write_byte(0)
write_string(sz)
message_end();
message_begin(MSG_ALL,get_user_msgid("ScoreInfo"))
write_byte(players)
write_short(get_user_frags(players))
write_short(get_user_frags(players)+1)
write_short(0)
write_short(get_user_team(players))
message_end();
message_begin(MSG_ALL,get_user_msgid("ScoreInfo"))
write_byte(owner)
write_short((team1 != team2)?(get_user_frags(owner)+1):(get_user_frags(owner)-1))
write_short(get_user_frags(owner))
write_short(0)
write_short(get_user_team(owner))
message_end();
set_user_frags(owner,(team1 != team2)?(get_user_frags(owner)+1):(get_user_frags(owner)-1))
} else {
set_user_health(players,health)
message_begin(MSG_ONE,get_user_msgid("Damage"),{0,0,0},players)
write_byte( 0 );
write_byte( cdi );
write_long( DMG_BLAST );
write_coord( vec[0] );
write_coord( vec[1] );
write_coord( vec[2] );
message_end();
}
}
}