Raised This Month: $ Target: $400
 0% 

Creating entity doesn't work


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-17-2013 , 15:25   Creating entity doesn't work
Reply With Quote #1

Hi all. I'm trying to make an entity but it doesn't work
here's the code:
PHP Code:
#include <amxmodx>
#include <engine>

new const model_1[] = "models/modelA.mdl";

public 
plugin_init()
{
    
register_clcmd("say /create""create");
    
register_clcmd("say_team /create""create");
}

public 
plugin_precache() precache_model(model_1);

SetEntitySize(entsize)
{
    new 
FloatflSize 32.0 size;
    
    new 
FloatVecFlMax[3];
    
VecFlMax[0] = flSize
    
VecFlMax[1] = flSize
    
VecFlMax[2] = 9.0;
    
    new 
FloatVecFlMin[3];
    
VecFlMin[0] = -flSize
    
VecFlMin[1] = -flSize
    
VecFlMin[2] = -9.0;
    
    
entity_set_size(entVecFlMinVecFlMax);
}

SetEntityRendering(idFxFloat:RFloat:GFloat:BRenderFloat:Amount)
{
    new 
Float:fVecColor[3];
    
fVecColor[0] = R;
    
fVecColor[1] = G;
    
fVecColor[2] = B;

    
entity_set_int(idEV_INT_renderfxFx);
    
entity_set_vector(idEV_VEC_rendercolorfVecColor);
    
entity_set_int(idEV_INT_rendermodeRender);
    
entity_set_float(idEV_FL_renderamtAmount);
}

public 
create(id)
{
    new 
Float:EntityOrigin[3];
    
entity_get_vector(idEV_VEC_view_ofsEntityOrigin);
    
EntityOrigin[2]+=18.0;
    
    new 
ent create_entity("info_target");
    
entity_set_string(entEV_SZ_classname"sth"); // What is this for ? Can someone tell me, please
    
    
entity_set_vector(entEV_VEC_originEntityOrigin);
    
    
entity_set_int(entEV_INT_solid2);
    
    
SetEntitySize(ent1);
    
SetEntityRendering(idkRenderFxNone255.0255.0255.0kRenderNormal0.0);
    
    
entity_set_model(entmodel_1);
    
    
entity_set_int(entEV_INT_sequence0);
    
entity_set_float(entEV_FL_animtime2.0);
    
entity_set_float(entEV_FL_framerate1.0);

BTW, can the problem comes from the model sizes ?

Last edited by didoWEE; 04-17-2013 at 15:32.
didoWEE is offline
 


Thread Tools
Display Modes

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 10:57.


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