|
Veteran Member
|

05-14-2013
, 02:01
Re: Create new entity and give him spr model, need help :)
|
#1
|
I know this thread is old but I was wondering if someone can help on why I get this error
Run time error 4: index out of bounds
For this line : entity_set_vector(ent, EV_VEC_rendercolor, colors[rand])
PHP Code:
new Float:colors[TOTALCOLORS][3] = {
{255.0, 0.0, 0.0},
{165.0, 0.0, 0.0},
{255.0, 100.0, 100.0},
{0.0, 0.0, 255.0},
{0.0, 0.0, 136.0},
{95.0, 200.0, 255.0},
{0.0, 150.0, 255.0},
{0.0, 255.0, 0.0},
{180.0, 255.0, 175.0},
{0.0, 155.0, 0.0},
{255.0, 255.0, 255.0},
{255.0, 255.0, 0.0},
{189.0, 182.0, 0.0},
{255.0, 255.0, 109.0},
{255.0, 150.0, 0.0},
{255.0, 190.0, 90.0},
{222.0, 110.0, 0.0},
{243.0, 138.0, 255.0},
{255.0, 0.0, 255.0},
{150.0, 0.0, 150.0},
{100.0, 0.0, 100.0},
{200.0, 0.0, 0.0},
{220.0, 220.0, 0.0},
{192.0, 192.0, 192.0},
{190.0, 100.0, 10.0},
{114.0, 114.0, 114.0},
{0.0, 0.0, 150.0}
}
PHP Code:
new filename[32]
format(filename, 31, "models/box%d.mdl", random_num(1, 2))
if(random_num(1, 4) != 4)
{
new rand = random_num(1, TOTALCOLORS)
entity_set_int(ent, EV_INT_renderfx, kRenderFxGlowShell)
entity_set_float(ent, EV_FL_renderamt, 1000.0)
entity_set_int(ent, EV_INT_rendermode, kRenderTransAlpha)
entity_set_vector(ent, EV_VEC_rendercolor, colors[rand])
}
__________________
|
|