AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Glow entity (https://forums.alliedmods.net/showthread.php?t=299426)

D3XT3R 07-14-2017 08:04

Glow entity
 
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 07-14-2017 08:06

Re: Glow entity
 
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 );
}

OciXCrom 07-14-2017 10:23

Re: Glow entity
 
Read the cvar as a string and use parse to get each number, then str_to_num.

D3XT3R 07-14-2017 13:17

Re: Glow entity
 
Any Example?

CrazY. 07-14-2017 13:58

Re: Glow entity
 
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

kristi 07-14-2017 14:20

Re: Glow entity
 
0.55 for me.
http://i.imgur.com/bJLktKJ.png

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

D3XT3R 07-14-2017 14:21

Re: Glow entity
 
thanx but not helpfull

DjSoftero 07-14-2017 14:35

Re: Glow entity
 
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.

D3XT3R 07-14-2017 14:40

Re: Glow entity
 
Quote:

Originally Posted by DjSoftero (Post 2535333)
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


All times are GMT -4. The time now is 23:11.

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