I've been trying to create a rainbow effect with my text and I'm now having a problem. Everytime I try to run this code it works fine until the PrintToChat "Test2".
If I moved that print to chat above where the for loop is then it will show but after the for loop nothing else runs.
Code:
if(strcmp(buffer, "1") == 0 && pos <= -1 || pos > 1 ){
ExplodeString(msg, " ", arraymsg, sizeof(arraymsg), sizeof(arraymsg[]))
for(new i = 0; i <= sizeof(arraymsg); i++)
{
switch(GetRandomInt(1, 8))
{
case 1:
msgcolour = " {blue}"
case 2:
msgcolour = " {red}"
case 3:
msgcolour = " {purple}"
case 4:
msgcolour = " {yellow}"
case 5:
msgcolour = " {green}"
case 6:
msgcolour = " {pink}"
case 7:
msgcolour = " {lime}"
case 8:
msgcolour = " {aqua}"
}
StrCat(arraymsg[i], sizeof(arraymsg), msgcolour);
}
PrintToChat(client, "Test2")
ImplodeStrings(arraymsg, sizeof(arraymsg), " ", endmsg, sizeof(endmsg))
CPrintToChatAllEx(client, "{aqua}%s{teamcolor}%s {default}: %s", tag, name, endmsg)
return Plugin_Handled;
}
__________________