Error About Vector, and Origin from Attachment. Rotate the entity and error...How to solve it ?
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <xs>
#define PLUGIN "Dias's Rocket Launcher"
#define VERSION "1.0"
#define AUTHOR "Dias Leon"
new const Float:g_Origin[3], Float:g_Angles[3]
new const rocketlauncher_model[] = "models/player/gign/gign.mdl"
new const rocket_model[] = "models/dron_missile.mdl"
new g_ent
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /get_origin", "get_origin")
register_clcmd("say /make", "make_rocketlauncher")
register_clcmd("say /launch", "launch_rocket")
}
public plugin_precache()
{
engfunc(EngFunc_PrecacheModel, rocketlauncher_model)
engfunc(EngFunc_PrecacheModel, rocket_model)
}
public get_origin(id)
{
pev(id, pev_origin, g_Origin)
pev(id, pev_angles, g_Angles)
}
public make_rocketlauncher(id)
{
new ent = create_entity("info_target")
g_ent = ent
entity_set_origin(ent, g_Origin)
entity_set_vector(ent, EV_VEC_angles, g_Angles)
entity_set_string(ent, EV_SZ_classname, "rocketlauncher")
entity_set_model(ent, rocketlauncher_model)
entity_set_int(ent, EV_INT_solid, SOLID_SLIDEBOX)
entity_set_int(ent, EV_INT_movetype, MOVETYPE_NONE)
new Float:maxs[3] = {16.0,16.0,36.0}
new Float:mins[3] = {-16.0,-16.0,-36.0}
entity_set_size(ent, mins, maxs)
entity_set_float(ent, EV_FL_animtime, get_gametime())
entity_set_float(ent, EV_FL_framerate, 1.0)
entity_set_int(ent, EV_INT_sequence, 0)
drop_to_floor(ent)
}
public launch_rocket(id)
{
static launcher
launcher = g_ent
static ent
ent = create_entity("info_target")
static Float:Origin[3], Float:Angles[3]
engfunc(EngFunc_GetAttachment, launcher, 0, Origin, Angles)
pev(launcher, pev_angles, Angles)
entity_set_origin(ent, Origin)
entity_set_vector(ent, EV_VEC_angles, Angles)
entity_set_string(ent, EV_SZ_classname, "rocket")
entity_set_model(ent, rocket_model)
entity_set_int(ent, EV_INT_solid, SOLID_SLIDEBOX)
entity_set_int(ent, EV_INT_movetype, MOVETYPE_NONE)
new Float:maxs[3] = {16.0,16.0,36.0}
new Float:mins[3] = {-16.0,-16.0,-36.0}
entity_set_size(ent, mins, maxs)
entity_set_float(ent, EV_FL_animtime, get_gametime())
entity_set_float(ent, EV_FL_framerate, 1.0)
entity_set_int(ent, EV_INT_sequence, 0)
engfunc(EngFunc_MakeVectors, Angles)
set_pev(ent, pev_velocity, Angles)
}