Raised This Month: $ Target: $400
 0% 

Create new entity and give him spr model, need help :)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 06-20-2011 , 07:18   Create new entity and give him spr model, need help :)
Reply With Quote #1

Hi

I have created a new entity "flare light glow"

PHP Code:
  // Flare Glow
  
entity_set_stringiEntityEV_SZ_classnameevnlightclassname );
  
entity_set_intiEntityEV_INT_solidSOLID_NOT );
  
entity_set_intiEntityEV_INT_movetypeMOVETYPE_NONE );
  
entity_set_modeliEntityEvNFlareGlow );
  new 
Float:RGB];
  
RGB] = str_to_floatcolor[0] );
  
RGB] = str_to_floatcolor[1] );
  
RGB] = str_to_floatcolor[2] );
  
entity_set_vectoriEntityEV_VEC_rendercolorRGB );
  
entity_set_floatiEntityEV_FL_scale0.5 );
  
entity_set_floatiEntityEV_FL_nextthinkget_gametime() + 2.0 );
  
entity_set_originiEntityoriginF ); 
I need to set render mode "Additive"
And FX Amount "90"

Like i can do valve hammer editor, env_sprite
and there are that options

Render FX
Render Mode
FX Amount

But how i do this in amxmodx scripting?

I have search that engine_const.inc where i found
EV_VEC_rendercolor and EV_FL_scale

But there are no sucks things like FX amount or FX mode


thanking in advance.
And sorry for my bad english.
.Dare Devil. is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-20-2011 , 07:24   Re: Create new entity and give him spr model, need help :)
Reply With Quote #2

See kRender* constants. (amxconst.inc)
__________________
Arkshine is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 06-20-2011 , 07:33   Re: Create new entity and give him spr model, need help :)
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
See kRender* constants. (amxconst.inc)
I just find this

EV_INT_rendermode,
EV_INT_renderfx

But how i use them i mean

entity_set_vector( iEntity, EV_INT_renderfx, 90 ); right ?
entity_set_vector( iEntity, EV_INT_rendermode, IhaveNoIdea );


Edit : found more

entity_set_int(index,EV_INT_rendermode,render ); Render ? like just "ADDITIVE"
entity_set_float(index,EV_FL_renderamt,float( amount)); tahts ok now.

Last edited by .Dare Devil.; 06-20-2011 at 07:36.
.Dare Devil. is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-20-2011 , 07:36   Re: Create new entity and give him spr model, need help :)
Reply With Quote #4

Quote:
Originally Posted by Arkshine View Post
See kRender* constants. (amxconst.inc)
__________________
Arkshine is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 06-20-2011 , 07:37   Re: Create new entity and give him spr model, need help :)
Reply With Quote #5

Thanks

Thats help.
.Dare Devil. is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-20-2011 , 14:12   Re: Create new entity and give him spr model, need help :)
Reply With Quote #6

You can use set_rendering() instead of setting the renderfx and stuff like that.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 06-20-2011 , 16:16   Re: Create new entity and give him spr model, need help :)
Reply With Quote #7

Quote:
Originally Posted by drekes View Post
You can use set_rendering() instead of setting the renderfx and stuff like that.
thanks, but set_pev(iEntity,pev_rendermode,kRenderTransAd d);
working fine
.Dare Devil. is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-20-2011 , 16:21   Re: Create new entity and give him spr model, need help :)
Reply With Quote #8

Quote:
Originally Posted by .Dare Devil. View Post
thanks, but set_pev(iEntity,pev_rendermode,kRenderTransAd d);
working fine
That may be true, but using set_user_rendering() is faster than using set_pev() if you are changing more than 1 value (rendermode, renderfx, renderamt, rendercolor).
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 06-20-2011 , 16:25   Re: Create new entity and give him spr model, need help :)
Reply With Quote #9

Note, just set_user_rendering() is faster because it's a module function, set_rendering() is a stock, from engine_stocks.inc:
Code:
/*  Set rendering of an entity */
stock set_rendering(index, fx=kRenderFxNone, r=255, g=255, b=255, render=kRenderNormal, amount=16)
{
    entity_set_int(index,EV_INT_renderfx,fx);
    new Float:RenderColor[3];
    RenderColor[0] = float(r);
    RenderColor[1] = float(g);
    RenderColor[2] = float(b);
    entity_set_vector(index,EV_VEC_rendercolor,RenderColor);
    entity_set_int(index,EV_INT_rendermode,render);
    entity_set_float(index,EV_FL_renderamt,float(amount));

    return 1;
}
And AFAIK set_user_rendering() checks if entity is player, so you can't use it on your custom entities, like the one in your thread.
__________________
Hunter-Digital is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-20-2011 , 16:25   Re: Create new entity and give him spr model, need help :)
Reply With Quote #10

set_user_rendering is only for player.
__________________
Arkshine is offline
Reply


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 23:35.


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