Code:
public client_PostThink(id)
{
if (FxArray[id]==1)
{
new scale[12], brightness[12]
read_argv(1, scale, 11)
read_argv(2, brightness, 11)
new origin[3];
get_user_origin(id,origin);
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(TE_SPRITE);
write_coord(origin[0]);
write_coord(origin[0] -= 1);
write_coord(origin[0] += 1);
write_short(sprite); // short (sprite index)
write_byte(str_to_num(scale)); // byte (scale in 0.1's)
write_byte(str_to_num(brightness)); // byte (brightness)
message_end();
}
else if (FxArray[id]==0)
{
}
return PLUGIN_CONTINUE
}
When i set the scale and brightness right into the plugin it works.
But when i wanna use the code with str_to_num it only plays 1 cycle and then it dissapears again.
While this snippet works but not customaizable via the ingame console.
Code:
public client_PostThink(id)
{
if (FxArray[id]==1)
{
new origin[3];
get_user_origin(id,origin);
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(TE_SPRITE);
write_coord(origin[0]);
write_coord(origin[0] -= 1);
write_coord(origin[0] += 1);
write_short(sprite); // short (sprite index)
write_byte(6); // byte (scale in 0.1's)
write_byte(111); // byte (brightness)
message_end();
}
else if (FxArray[id]==0)
{
}
return PLUGIN_CONTINUE
}
So HOW do i make it so i can use str_to_num in the snippet without vanishing after 1 cycle ?
__________________