Hi,
I am facing a problem in some lines of code, I want to spawn model (entity) "w_ak47.mdl" (Just for testing purposes) and set it's origin to where I aim. But It does not work. Let's get to the point... this is the code :
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#define PLUGIN "-"
#define VERSION "1.0"
#define AUTHOR "-"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /ent","CreateEnt")
}
public plugin_precache()
{
precache_model("models/w_ak47.mdl")
}
public CreateEnt(id)
{
new float:aimorigin[3]
pev(id,pev_v_angle,aimorigin)
new ent = create_entity("info_target")
entity_set_model(ent,"models/w_ak47.mdl")
entity_set_origin(ent,aimorigin)
entity_set_size(ent,Float:{-16.0,-16.0,-16.0},Float:{16.0,16.0,16.0})
entity_set_int(ent,EV_INT_solid,SOLID_BBOX)
entity_set_float(ent,EV_FL_takedamage,DAMAGE_AIM)
entity_set_float(ent,EV_FL_health,100.0)
}
Thanks in advance !