Why did you do this
PHP Code:
new players[32], num;
get_players(players, num);
if you used MSG_BROADCAST? It's redundant.
For some reason you decided not to change the way your text gets printed nor consider the reasons for this change:
1. Currently you limited the size to 11 lines. Consider the fact that you have 142390644 lines.
2. ALL your lines get printed at once. That could spam the chat.
This can be fixed. All you have to do is print a SINGLE line at a time. Since your text has no prefix attached you could use "^n" if multiple lines is a must. Doing this will also fix the overflow error when using MSG_ONE.
[EDIT]
In case you decide to change it, you have 2 ways of doing it:
1. With incrementing lines.
2. With random lines.
You can change MSG_ONE to MSG_ONE_UNRELIABLE if you wish.
1. Code follows:
PHP Code:
public display_message(){
new players[32], num
static line
get_players(players, num, "ch")
for(new i = 0; i < num; i++){
message_begin(MSG_ONE, MsgSayText)
write_byte(players[i])
write_string(ads[line])
message_end()
}
// Increment the current line
// If we displayed all lines then go to the first line
// (for a cyclic display)
++line
if(line == total_lines) line = 0
}
2.
PHP Code:
public display_message(){
new players[32], num, line
// A random line to display
line = random_num(0, total_lines - 1)
get_players(players, num, "ch")
for(new i = 0; i < num; i++){
message_begin(MSG_ONE, MsgSayText)
write_byte(players[i])
write_string(ads[line])
message_end()
}
}