Raised This Month: $51 Target: $400
 12% 

Chat Text Error/ExplodingImploding String


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Riotline
AlliedModders Donor
Join Date: Oct 2015
Location: Half Life 3
Old 06-28-2017 , 00:59   Chat Text Error/ExplodingImploding String
Reply With Quote #1

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;
	}
__________________
Riotline is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode