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

UTIL_PrintConsole


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
@Ivan
Junior Member
Join Date: Jun 2012
Location: Venezuela
Old 10-16-2013 , 14:27   UTIL_PrintConsole
Reply With Quote #1

I have a problem with this function

PHP Code:
// Print Types
#define HUD_PRINTNOTIFY  1
#define HUD_PRINTCONSOLE 2
#define HUD_PRINTCHAT     3
#define HUD_PRINTCENTER     4

void UTIL_ClientPrint(edict_t * const pEdict, const int type, const char *fmt, ...)
{
    if(!
REG_USER_MSG("TextMsg", -1))
        return;

    
char buffer[192];
    
va_list ap;
    
va_start(apfmt);
    
vsnprintf(buffersizeof(buffer) - 1fmtap);
    
va_end(ap);

    if(
pEdict)
        
MESSAGE_BEGIN(MSG_ONEREG_USER_MSG("TextMsg", -1), NULLpEdict);
    else
        
MESSAGE_BEGIN(MSG_BROADCASTREG_USER_MSG("TextMsg", -1));
    
WRITE_BYTE(type);
    
WRITE_STRING(buffer);
    
MESSAGE_END();

When I try to print something on a player console nothing appears.

PHP Code:
UTIL_ClientPrint(pEntity,HUD_PRINTCONSOLE,"HOLA\n");
UTIL_ClientPrint(pEntity,HUD_PRINTCONSOLE,"HOLA");
UTIL_ClientPrint(pEntity,HUD_PRINTCONSOLE,"HOLA\0"); 
I guess something is wrong.
@Ivan is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 10-16-2013 , 23:33   Re: UTIL_PrintConsole
Reply With Quote #2

Check CStrike module from the AMX Mod X source code.
__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
@Ivan
Junior Member
Join Date: Jun 2012
Location: Venezuela
Old 10-17-2013 , 09:38   Re: UTIL_PrintConsole
Reply With Quote #3

Yes but the problem is it does not work when I try to print the msg when a player enters: ClientConnect or PutInServer. If I print it later (ingame) if it works.
@Ivan is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 10-22-2013 , 03:15   Re: UTIL_PrintConsole
Reply With Quote #4

Try g_engfuncs.pfnClientPrintf.
__________________

Last edited by claudiuhks; 10-22-2013 at 03:15.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
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 04:27.


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