View Single Post
Old 09-12-2009, 11:24 PM   #6
-=*Raz0r*=-
Rookie
 
-=*Raz0r*=-'s Avatar
 
Join Date: Oct 2006
Location: Australia
Posts: 243
Well okay, I found a way to get line-feeds working =P
Code:
	p = G_NewString(p);		//insert line-breaks and stuff

	G_LogPrintf( "announce: %s: %s\n", ent->client->pers.netname, p ); //log the action in the server console
	trap_SendServerCommand( -1, va("cp \"%s\"", p) ); //print it on-screen

	free(p);

	return;
Mind you, I use a custom version of G_NewString which uses 'newb = (char*)malloc(l);' rather than 'newb = (char *) G_Alloc( l );'
You must free your memory! otherwise the server will crash after the function is called too many times.


Last edited by -=*Raz0r*=-; 09-26-2009 at 04:20 PM.
-=*Raz0r*=- is offline   you may: quote & reply,