View Single Post
Author Message
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 03-01-2012 , 09:30   Problem about Origin of EngFunc_Attachment
Reply With Quote #1

Error About Vector, and Origin from Attachment. Rotate the entity and error...How to solve it ?
[IMG]http://img339.**************/img339/5217/123oic.png[/IMG]

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(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /get_origin""get_origin")
    
register_clcmd("say /make""make_rocketlauncher")
    
register_clcmd("say /launch""launch_rocket")
}

public 
plugin_precache()
{
    
engfunc(EngFunc_PrecacheModelrocketlauncher_model)
    
engfunc(EngFunc_PrecacheModelrocket_model)
}

public 
get_origin(id)
{
    
pev(idpev_origing_Origin)
    
pev(idpev_anglesg_Angles)
}

public 
make_rocketlauncher(id)
{
    new 
ent create_entity("info_target")
    
g_ent ent
    
    entity_set_origin
(entg_Origin)
    
entity_set_vector(entEV_VEC_anglesg_Angles)
    
    
entity_set_string(entEV_SZ_classname"rocketlauncher")
    
entity_set_model(entrocketlauncher_model)
    
entity_set_int(entEV_INT_solidSOLID_SLIDEBOX)
    
entity_set_int(entEV_INT_movetypeMOVETYPE_NONE)
    
    new 
Float:maxs[3] = {16.0,16.0,36.0}
    new 
Float:mins[3] = {-16.0,-16.0,-36.0}
    
entity_set_size(entminsmaxs)
    
    
entity_set_float(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)    
    
entity_set_int(entEV_INT_sequence0)        

    
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_GetAttachmentlauncher0OriginAngles)
    
pev(launcherpev_anglesAngles)
    
    
entity_set_origin(entOrigin)
    
entity_set_vector(entEV_VEC_anglesAngles)
    
    
entity_set_string(entEV_SZ_classname"rocket")
    
entity_set_model(entrocket_model)
    
entity_set_int(entEV_INT_solidSOLID_SLIDEBOX)
    
entity_set_int(entEV_INT_movetypeMOVETYPE_NONE)
    
    new 
Float:maxs[3] = {16.0,16.0,36.0}
    new 
Float:mins[3] = {-16.0,-16.0,-36.0}
    
entity_set_size(entminsmaxs)
    
    
entity_set_float(entEV_FL_animtimeget_gametime())
    
entity_set_float(entEV_FL_framerate1.0)    
    
entity_set_int(entEV_INT_sequence0)    
    
    
engfunc(EngFunc_MakeVectorsAngles)
    
set_pev(entpev_velocityAngles)


Last edited by dias; 03-01-2012 at 09:31.
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias