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

PrintToConsole() working?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bennyboy
New Member
Join Date: Mar 2007
Old 05-25-2007 , 17:57   PrintToConsole() working?
Reply With Quote #1

Hi.

I have just got into SourceMod - it's extremely impressive. I have downloaded revision 855, installed it and run the examples, and even compiled and run my own extension.

However... it can't get the PrintToConsole() function to display anything ingame. Is anyone else having this touble?

I tried devicenull's alternative method (as below), and this works fine, so I'm slightly puzzled.

Server version (Windows):
-------------------------------
Protocol version 7
Exe version 1.0.0.34 (cstrike)
Exe build: 18:49:09 Mar 7 2007 (3042)

Any ideas?
Thanks.

stock CPrint(client,String:tosend[],{Float,String,_}:...)
{
decl String:buff[512];
VFormat(buff,512,tosend,3);
decl Handle:msg;
if (client == 0) msg = StartMessageAll("SayText",0);
else msg = StartMessageOne("SayText",client,0);
BfWriteByte(msg,0);
BfWriteString(msg,buff);
BfWriteByte(msg,1);
EndMessage();
}
bennyboy is offline
dutchmeat
Senior Member
Join Date: Sep 2006
Old 05-25-2007 , 18:19   Re: PrintToConsole() working?
Reply With Quote #2

That isn't PrintToConsole, it's a hudmessage.
This is printtoconsole:

Code:
PrintToConsole(client, "Hello ");

And this is a correct example of a HUD message:

Code:
decl String:display_message[192];     Format(display_message, 192, "\x01 %s", "Hello World!");         decl Handle:hBf;     hBf = StartMessageOne("SayText2", client);     if (hBf != INVALID_HANDLE) {      BfWriteByte(hBf, 1);      BfWriteByte(hBf, 0);      BfWriteString(hBf, display_message);      EndMessage();     }
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.
dutchmeat is offline
BAILOPAN
Join Date: Jan 2004
Old 05-25-2007 , 20:18   Re: PrintToConsole() working?
Reply With Quote #3

fyi, printtoconsole writes to a client's console, not chat text. it wll always work regardless of the mod.

glad you like sourcemod ;)
__________________
egg
BAILOPAN is offline
bennyboy
New Member
Join Date: Mar 2007
Old 05-29-2007 , 10:58   Re: PrintToConsole() working?
Reply With Quote #4

Oops. In hindsight, I see the error of my ways. Thanks for the responses - I did actually want the HUD messaging functions, so I shall now familiarize myself to the contents of usermessages.inc, and the display_message() function provided.

Thanks,
Ben
bennyboy is offline
Reply



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 10:50.


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