Raised This Month: $32 Target: $400
 8% 

hooking game start or messages


Post New Thread Reply   
 
Thread Tools Display Modes
killerZM
Senior Member
Join Date: Sep 2016
Old 08-28-2017 , 10:07   Re: hooking game start or messages
Reply With Quote #11

ok
do u recommned any site to be more good in c++
killerZM is offline
Beqa Gurgenidze
BANNED
Join Date: Nov 2016
Old 08-29-2017 , 02:17   Re: hooking game start or messages
Reply With Quote #12

Quote:
Originally Posted by killerZM View Post
ok
do u recommned any site to be more good in c++
I am only using https://stackoverflow.com/

In this site people help each other in programming.

Last edited by Beqa Gurgenidze; 08-29-2017 at 02:18.
Beqa Gurgenidze is offline
killerZM
Senior Member
Join Date: Sep 2016
Old 08-29-2017 , 12:59   Re: hooking game start or messages
Reply With Quote #13

ok bro tyvm
when you find the way of making HUD and menu tell me please
killerZM is offline
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
killerZM
Senior Member
Join Date: Sep 2016
Old 08-30-2017 , 11:53   Re: hooking game start or messages
Reply With Quote #15

ty and menu ?
killerZM is offline
Beqa Gurgenidze
BANNED
Join Date: Nov 2016
Old 08-30-2017 , 12:13   Re: hooking game start or messages
Reply With Quote #16

Quote:
Originally Posted by killerzm View Post
ty and menu ?
................................
Still working on it.
Beqa Gurgenidze is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 08-30-2017 , 13:47   Re: hooking game start or messages
Reply With Quote #17

Quote:
Originally Posted by killerZM View Post
ty and menu ?
Just check for
Quote:
void UTIL_ShowMenu(edict_t* pEdict, int slots, int time, char *menu, int mlen)
at amxmodx/util.cpp

Why everyone tries to reinvent the wheel?
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
killerZM
Senior Member
Join Date: Sep 2016
Old 09-02-2017 , 08:36   Re: hooking game start or messages
Reply With Quote #18

another thing
how to get player entity in msg hook ?
killerZM is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 09-02-2017 , 08:41   Re: hooking game start or messages
Reply With Quote #19

It's passed to pfnMessageBegin, last param.
klippy is offline
killerZM
Senior Member
Join Date: Sep 2016
Old 09-02-2017 , 12:23   Re: hooking game start or messages
Reply With Quote #20

thank you

how to hook player entity in write byte ?

Last edited by killerZM; 09-15-2017 at 17:49.
killerZM 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 06:55.


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