Raised This Month: $ Target: $400
 0% 

metamod plugin call client engine functions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jim_yang
Veteran Member
Join Date: Aug 2006
Old 10-11-2011 , 10:29   metamod plugin call client engine functions
Reply With Quote #1

I want to draw a square on my screen, I test it in listen server, so I do it in a metamod plugin, I succeed got the global cl_enginefunc_t * pointer,
g_pclengfuncs->pfnClientCmd("clear\n"); and some other functions works fine,
but
g_pclengfuncs->pfnFillRGBA(500, 400, 100, 50, 255, 0, 0, 255); didn't show anything, I wonder what's going on...
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>

Last edited by jim_yang; 10-14-2011 at 07:05. Reason: last problem solved by myself
jim_yang is offline
BB.O.
Member
Join Date: Feb 2011
Old 10-14-2011 , 11:02   Re: metamod plugin call client engine functions
Reply With Quote #2

Good trying! I want to do this too.
BB.O. is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 10-15-2011 , 02:43   Re: metamod plugin call client engine functions
Reply With Quote #3

Code:
	g_pclengfuncs = (cl_enginefunc_t *)(OFFSET_CLIENT_ENGFUNC);
	memcpy(&g_clengfuncs, g_pclengfuncs, sizeof(cl_enginefunc_t));
	
	wrect_t rc;
	rc.left = 500;
	rc.top = 400;
	rc.right = 600;
	rc.bottom = 500;

	HSPRITE_t hspr = g_clengfuncs.pfnSPR_Load("sprites/crosshairs.spr");
	g_clengfuncs.pfnSetCrosshair(hspr, rc, 255, 255, 255);

	g_clengfuncs.pfnFillRGBA(500, 400, 100, 100, 255, 0, 0, 255);
I can see the crosshairs spr, but the square don't show, weird
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Immortal_BLG
Member
Join Date: Feb 2010
Location: RUSSIA
Old 10-19-2011 , 22:41   Re: metamod plugin call client engine functions
Reply With Quote #4

You should call pfnFillRGBA withing openGL draw frame (after R_SetupGL function call). For example from client functions HUD_DrawNormalTriangles, HUD_DrawTransparentTriangles, HUD_Redraw, ....
Immortal_BLG is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 10-19-2011 , 22:53   Re: metamod plugin call client engine functions
Reply With Quote #5

Thanks for the tip, I've already figured it out after reading some cheat source. But still thanks for making it clear.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Old 10-07-2013, 08:11
kiki33hun
This message has been deleted by kiki33hun.
Old 03-04-2022, 14:27
redivcram
This message has been deleted by redivcram.
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 23:26.


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