Thread: [Solved] Correct way to do this?
View Single Post
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-10-2018 , 14:29   Re: Correct way to do this?
Reply With Quote #4

FYI,

While this may work, it is uses improper (confusing) functions to do it:

Code:
gSChars[random_num(0, charsmax(gSChars))]
In this case, you are not doing anything with characters, you are selecting an index of an array (where the result happens to be a string). To make this more proper (i.e. less confusing) you would do this:

Code:
gSChars[random(sizeof gSChars)]
Also, if your format string is ever just "%s" then there is no need to have a format string, simply pass the variable directly to the function:

Code:
ColorChat(id, GREY, SCode);
__________________

Last edited by fysiks; 03-10-2018 at 14:32.
fysiks is offline