ok i worked everything out.
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <engine>
new gExplosionModel
public plugin_precache()
{
precache_model("models/player/predator2/predator2.mdl")
precache_model("sprites/plasma.spr")
gExplosionModel = precache_model("sprites/suicideexplode.spr")
precache_sound("misc/doh7.wav")
return PLUGIN_CONTINUE
}
public plugin_init()
{
register_plugin("Plasmatest","1.00","Haim")
register_clcmd("shoot","myfunc")
register_touch("PlasmaBall","*","plasma_interact")
}
public myfunc(id)
{
new origin[3], Float:fOrigin[3]
new Float:velocity[3]
get_user_origin(id,origin,1)
IVecFVec(origin, fOrigin)
new ePlasmaBall = create_entity("info_target")
entity_set_string(ePlasmaBall, EV_SZ_classname, "PlasmaBall")
new Float:posAdjust[3] //Used for adjusting the starting position
velocity_by_aim(id, 100, posAdjust) //You can replace 50 with whatever
fOrigin[0] += posAdjust[0]
fOrigin[1] += posAdjust[1]
fOrigin[2] += posAdjust[2]
entity_set_vector(ePlasmaBall, EV_VEC_origin, fOrigin)
entity_set_vector(ePlasmaBall, EV_VEC_origin,fOrigin)
new Float:maxs[3] = {1.0,1.0,1.5}
new Float:mins[3] = {-1.0,-1.0,-1.5}
entity_set_size(ePlasmaBall,mins,maxs)
entity_set_int(ePlasmaBall,EV_INT_solid, SOLID_BBOX)
entity_set_int(ePlasmaBall,EV_INT_movetype,MOVETYPE_FLYMISSILE)
entity_set_float(ePlasmaBall,EV_FL_framerate,5.0)
set_rendering(ePlasmaBall, kRenderFxNoDissipation, 0, 100, 255, kRenderGlow, 255)
entity_set_model(ePlasmaBall, "sprites/plasma.spr")
emit_sound(ePlasmaBall, CHAN_STATIC, "misc/doh7.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
VelocityByAim(id,800,velocity)
entity_set_vector(ePlasmaBall,EV_VEC_velocity,velocity)
}
public plasma_interact(ePlasmaBall,other) {
if(other == 0) {
new Float:fOrigin[3]
new iOrigin[3]
entity_get_vector(ePlasmaBall, EV_VEC_origin, fOrigin)
FVecIVec(fOrigin, iOrigin)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(3) // TE_EXPLOSION
write_coord(iOrigin[0])
write_coord(iOrigin[1])
write_coord(iOrigin[2]+50)
write_short(gExplosionModel)
write_byte(100)
write_byte(0)
write_byte(0)
message_end()
RadiusDamage(fOrigin, 15, 60)
remove_entity(ePlasmaBall)
}
else if(is_user_connected(other)) {
user_kill(other, 0)
}
}
i even changed the movetype from toss to flymissle... so now i really shoot plasma balls...