Raised This Month: $ Target: $400
 0% 

Problem about Origin of EngFunc_Attachment


Post New Thread Reply   
 
Thread Tools Display Modes
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
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-01-2012 , 13:25   Re: Problem about Origin of EngFunc_Attachment
Reply With Quote #2

Try :

public get_origin(id)
{
pev(id, pev_origin, g_Origin)
pev(id, pev_v_angle, g_Angles)
}

So retrieve player v_angle, and use this value to set rocket angles (not v_angle there).
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 03-01-2012 , 17:52   Re: Problem about Origin of EngFunc_Attachment
Reply With Quote #3

Tried and Same error... =.=". I think it's matter about Origin

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



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode