View Single Post
Riotline
AlliedModders Donor
Join Date: Oct 2015
Location: Half Life 3
Old 06-29-2017 , 03:42   Re: Chat Text Error/ExplodingImploding String
Reply With Quote #6

Sorry the Logs from my server is showing an error from using the GetRandomColours and the C_SplitString...

Just to ask you incase I may have applied it incorrectly but I just put a string into the GetRandomColours right?

Updated Code:
Code:
//Chat
public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs)
{
	new String:buffer[16], String:name[MAX_NAME_LENGTH], String:tag[128], pos = FindCharInString(sArgs, '/'), String:msg[512];
	GetClientName(client, name, sizeof(name));
	GetClientCookie(client, VIPChatTextClient, buffer, sizeof(buffer));
	CCC_GetTag(client, tag, sizeof(tag));
	strcopy(msg, sizeof(msg), sArgs);
	
	if(strcmp(buffer, "1") == 0 && pos <= -1 || pos > 1 ){
		PrintToChatAll("Test");
		GetRandomColours(sArgs);
		CPrintToChatAll("{aqua}%s\x03%s {default}: %s", tag, name, sArgs);
		return Plugin_Handled;
	}
	
	if(strcmp(buffer, "1") == 0 && pos > -1){
		return Plugin_Handled;
	}
	return Plugin_Continue;
}
__________________
Riotline is offline