Raised This Month: $ Target: $400
 0% 

hooking game start or messages


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Beqa Gurgenidze
BANNED
Join Date: Nov 2016
Old 08-30-2017 , 01:42   Re: hooking game start or messages
Reply With Quote #14

Quote:
Originally Posted by killerZM View Post
ok bro tyvm
when you find the way of making HUD and menu tell me please
CareFull With Channels on normal hudmessage. -1 channel is not working here.
FIT = FadeInTime
FOT = FadeOutTime
HT = HoldTime
FT = FxTime (Effects)

Code:
inline unsigned short FU16(float value, float scale)
{
	int output;

	output = value * scale;
	if (output < 0)
		output = 0;
	if (output > 0xFFFF)
		output = 0xFFFF;

	return (unsigned short)output;
}

inline unsigned short FS16(float value, float scale)
{
	int output;

	output = value * scale;

	if (output > 32767)
		output = 32767;

	if (output < -32768)
		output = -32768;

	return (short)output;
}

void _fastcall ShowHUDMessage(edict_t *pEdict, float X, float Y, int Effects, int R, int G, int B, float FIT, float FOT, float HT, float FXTime, int Channel, char Message[])
{
	if (pEdict)
		MESSAGE_BEGIN(MSG_ONE, SVC_TEMPENTITY, NULL, pEdict);
	else
		MESSAGE_BEGIN(MSG_BROADCAST, SVC_DIRECTOR, NULL, NULL);
	WRITE_BYTE(TE_TEXTMESSAGE);
	WRITE_BYTE(Channel & 0xFF);
	WRITE_SHORT(FS16(X, 1 << 13));
	WRITE_SHORT(FS16(Y, 1 << 13));
	WRITE_BYTE(Effects);
	WRITE_BYTE(R);
	WRITE_BYTE(G);
	WRITE_BYTE(B);
	WRITE_BYTE(0);
	WRITE_BYTE(255);
	WRITE_BYTE(255);
	WRITE_BYTE(255);
	WRITE_BYTE(0);
	WRITE_SHORT(FU16(FIT, 1 << 8));
	WRITE_SHORT(FU16(FOT, 1 << 8));
	WRITE_SHORT(FU16(HT, 1 << 8));
	WRITE_STRING(Message);
	MESSAGE_END();

}

void _fastcall ShowDHUDMessage(edict_t *pEntity, float X, float Y, int Effects, int R, int G, int B, float FIT, float FOT, float HT, float FT, const char *pMessage, int Length)
{
	#define DRC_CMD_MESSAGE 6

	if (pEntity)
		MESSAGE_BEGIN(MSG_ONE_UNRELIABLE, SVC_DIRECTOR, NULL, pEntity);
	else
		MESSAGE_BEGIN(MSG_BROADCAST, SVC_DIRECTOR, NULL, NULL);

	WRITE_BYTE(Length);
	WRITE_BYTE(DRC_CMD_MESSAGE);
	WRITE_BYTE(Effects);
	WRITE_LONG((unsigned char)B + ((unsigned char)G << 8) + ((unsigned char)R << 16));
	WRITE_LONG((*((cell*)&X)));
	WRITE_LONG((*((cell*)&Y)));
	WRITE_LONG((*((cell*)&FIT)));
	WRITE_LONG((*((cell*)&FOT)));
	WRITE_LONG((*((cell*)&HT)));
	WRITE_LONG((*((cell*)&FT)));
	WRITE_STRING(pMessage);
	MESSAGE_END();
}

Last edited by Beqa Gurgenidze; 08-30-2017 at 01:43.
Beqa Gurgenidze 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 01:09.


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