Raised This Month: $ Target: $400
 0% 

Glow entity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 07-14-2017 , 08:04   Glow entity
Reply With Quote #1

any ideas to make the glow throw cvar?

Example
Cvar Glow 255 255 255
this script is now with random glow i want make it work trhow 1 cvar and config it as 255 255 025
and if the cvar is "" so it make the random glow as default

PHP Code:
entity_set_int(ent,EV_INT_iuser1,random(255)) 
entity_set_int(ent,EV_INT_iuser2,random(255)) 
entity_set_int(ent,EV_INT_iuser3,random(255)) 

set_rendering(ent,kRenderFxGlowShell,entity_get_int(ent,EV_INT_iuser1),entity_get_int(ent,EV_INT_iuser2),entity_get_int(ent,EV_INT_iuser3),kRenderNormal,60

__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 07-14-2017 , 08:06   Re: Glow entity
Reply With Quote #2

I try this but it has 3 cvars

if( bool: get_pcvar_num( cvar_glow ) ) {
new Float: vector_render[ 3 ];
vector_render[ 0 ] = get_pcvar_float( cvar_red );
vector_render[ 1 ] = get_pcvar_float( cvar_green );
vector_render[ 2 ] = get_pcvar_float( cvar_blue );
entity_set_vector( entity, EV_VEC_rendercolor, vector_render );
}
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-14-2017 , 10:23   Re: Glow entity
Reply With Quote #3

Read the cvar as a string and use parse to get each number, then str_to_num.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 07-14-2017 , 13:17   Re: Glow entity
Reply With Quote #4

Any Example?
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 07-14-2017 , 13:58   Re: Glow entity
Reply With Quote #5

0.5 seconds on google.

https://www.amxmodx.org/api/string/parse
https://www.amxmodx.org/api/cvars/__raw
https://www.amxmodx.org/api/string/str_to_num
__________________








CrazY. is offline
kristi
Senior Member
Join Date: Nov 2016
Old 07-14-2017 , 14:20   Re: Glow entity
Reply With Quote #6

0.55 for me.


https://forums.alliedmods.net/showthread.php?t=217547

Last edited by kristi; 07-14-2017 at 14:36.
kristi is offline
Send a message via Skype™ to kristi
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 07-14-2017 , 14:21   Re: Glow entity
Reply With Quote #7

thanx but not helpfull
__________________

Last edited by D3XT3R; 07-14-2017 at 14:41.
D3XT3R is offline
Send a message via Skype™ to D3XT3R
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 07-14-2017 , 14:35   Re: Glow entity
Reply With Quote #8

PHP Code:
new rgb_colors[3]
new 
string_with_colors[20]="255 205 100"
new temp[3][25]

parse(string_with_colorscharsmax(string_with_colors), temp[0], 24temp[1], 24temp[2], 24)/*should be charsmax everywhere, but i lack in time.*/

rbg_colors[0] = str_to_num(temp[0])
rbg_colors[1] = str_to_num(temp[1])
rbg_colors[2] = str_to_num(temp[2])


entity_set_int(ent,EV_INT_iuser1,rgb_colors[0]) 
entity_set_int(ent,EV_INT_iuser2,rgb_colors[1]) 
entity_set_int(ent,EV_INT_iuser3,rgb_colors[2]) 

set_rendering(ent,kRenderFxGlowShell,entity_get_int(ent,EV_INT_iuser1),entity_get_int(ent,EV_INT_iuser2),entity_get_int(ent,EV_INT_iuser3),kRenderNormal,60

but i didn`t quite understand why you used entity_set_int.
__________________
retired chump

Last edited by DjSoftero; 07-14-2017 at 14:37.
DjSoftero is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 07-14-2017 , 14:40   Re: Glow entity
Reply With Quote #9

Quote:
Originally Posted by DjSoftero View Post
PHP Code:
new rgb_colors[3]
new 
string_with_colors[20]="255 205 100"
new temp[3][25]

parse(string_with_colorscharsmax(string_with_colors), temp[0], 24temp[1], 24temp[2], 24)/*should be charsmax everywhere, but i lack in time.*/

rbg_colors[0] = str_to_num(temp[0])
rbg_colors[1] = str_to_num(temp[1])
rbg_colors[2] = str_to_num(temp[2])


entity_set_int(ent,EV_INT_iuser1,rgb_colors[0]) 
entity_set_int(ent,EV_INT_iuser2,rgb_colors[1]) 
entity_set_int(ent,EV_INT_iuser3,rgb_colors[2]) 

set_rendering(ent,kRenderFxGlowShell,entity_get_int(ent,EV_INT_iuser1),entity_get_int(ent,EV_INT_iuser2),entity_get_int(ent,EV_INT_iuser3),kRenderNormal,60

but i didn`t quite understand why you used entity_set_int.
becuase its best option for ground model as i think
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
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 23:11.


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