When it comes to server side, you can do basically anything so there's definitely a solution.
I'm not completely sure here but I'm making some guesses.
I think {} is for the compiler, not runtime. So you might not be able to use it dynamically like you are doing. There might be a workaround but I would just reformat it:
Code:
new rgbiColor[3];
rgbiColor[0] = str_to_num(rgbColor[0]);
rgbiColor[1] = str_to_num(rgbColor[1]);
rgbiColor[2] = str_to_num(rgbColor[2]);
glow_player(idGlower, rgbiColor, 50)
There's no point of storing the string separately, you could just read one, transform it and the read the next.
Throw in some looping just for neatness.
Code:
new szName[32], rgbColor[3]
for ( new i = 0 ; i < 3 ; i++ ) {
read_argv(i + 2, szName, charsmax(szName)); // Use the szName as a temporary storage since we already have it.
rgbColor[i] = str_to_num(szName);
}
read_argv(1, szName, charsmax(szName)) // After we're done using szName for other purposes, we can use it for what we intended it for.
new idGlower = cmd_target(id, szName, CMDTARGET_ALLOW_SELF)
if ( idGlower ) // Check that cmd_target() actually found a target
glow_player(idGlower, rgbColor, 50)
Also, since the read_argv() function is getting a string you need to leave space for the null at the end. So either limit it to 2 characters using:
Code:
read_argv(, rgbColor[0], charsmax(rgbColor[])) // which is 2
or increase the size of the string to 3 + null (4):
Code:
new szName[32], rgbColor[3][4]
// ...
read_argv(, rgbColor[0], charsmax(rgbColor[])) // This should be used either way.
But this is already fixed in my previous example.
__________________