-
关注Ta
-
- 注册时间 2007-01-11
- 最后登录 2019-10-27
-
- 发帖447
- 在线117小时
- 精华6
- DB19221
- 威望208
- 保证金0
- 桃子0
- 鲜花0
- 鸡蛋0
-
访问TA的空间加好友用道具
|
—
本帖被 步惊天 执行加亮操作(2007-09-02)
—
包含一个基础路线版本,和一个未修复过的中文显示模块[颜色不正常] 本版本路线可顺利移植到 cs 1.6 的作弊器代码中,提供给有兴趣的玩家参考 再这里感谢MAX 风格 CCA_F117 制作 - mAX6.3源代码是可以无错编译连接的,这里我就不多说了...
- 关键是生成的DLL文件有文字颜色错误让人很不爽...
- 小弟我发现了几处错误如下:
- 1.本方与敌方的名字全部是黑的(不分敌我啊)很是不爽;
- 2.左边的信息栏队友说话也不是很清楚,模模糊糊;
- 3.作弊控制台 的字体也有问题;
- 下面来解决如下问题
- void DrawHudStringCenter
- void DrawHudString
- void RetarTMenuMenuStr2
- int Initialize
- 发现这几个函数都调用了源文件DrawText.cpp中的 DrawSetTextColorEx 可能是文字颜色出了问题
- 找到这段代码
- void DrawHudStringCenter (int x, int y, int r, int g, int b, const char *fmt, ... )
- {
- va_list va_alist;
- char buf[256];
- va_start (va_alist, fmt);
- _vsnprintf (buf, sizeof(buf), fmt, va_alist);
- va_end (va_alist);
- if( cvar.confont ) {
- int length, height;
- DrawConsoleStringLenEx(buf, &length, &height );
- x = x - length/2;
- DrawSetTextColorEx(/*(float)*/r/255.0,/*(float)*/g/255.0,/*(float)*/b/255.0);
- DrawConsoleStringEx(x,y,buf);
- } else {
- int borderY = displayCenterY*2-18;
- if( y<0 || y>borderY ) { return; }
- int drawLen = DrawLen(buf);
- x = x-drawLen/2;
- int borderX = displayCenterX*2-11;
- int minX = x;
- int maxX = x+drawLen;
- bool needSingleCheck = (minX<1 || maxX>borderX);
- if( needSingleCheck )
- {
- for ( char * p = buf; *p; p++ )
- {
- int next = x + screeninfo.charWidths[*p];
- if( x>0 && x<borderX )
- gEngfuncs.pfnDrawCharacter (x, y, *p, r, g, b);
- x = next;
- }
- } else {
- for ( char * p = buf; *p; p++ )
- {
- int next = x + screeninfo.charWidths[*p];
- gEngfuncs.pfnDrawCharacter (x, y, *p, r, g, b);
- x = next;
- }
- }
- }
- }
- 改成
- void DrawHudStringCenter (int x, int y, int r, int g, int b, const char *fmt, ... )
- {
- va_list va_alist;
- char buf[256];
- va_start (va_alist, fmt);
- _vsnprintf (buf, sizeof(buf), fmt, va_alist);
- va_end (va_alist);
- if( cvar.confont ) {
- int length, height;
- gEngfuncs.pfnDrawConsoleStringLen( buf, &length, &height );
- x = x - length/2;
- gEngfuncs.pfnDrawSetTextColor(/*(float)*/r/255.0,/*(float)*/g/255.0,/*(float)*/b/255.0);
- gEngfuncs.pfnDrawConsoleString(x,y,buf);
- } else {
- int borderY = displayCenterY*2-18;
- if( y<0 || y>borderY ) { return; }
- int drawLen = DrawLen(buf);
- x = x-drawLen/2;
- int borderX = displayCenterX*2-11;
- int minX = x;
- int maxX = x+drawLen;
- bool needSingleCheck = (minX<1 || maxX>borderX);
- if( needSingleCheck )
- {
- for ( char * p = buf; *p; p++ )
- {
- int next = x + screeninfo.charWidths[*p];
- if( x>0 && x<borderX )
- gEngfuncs.pfnDrawCharacter (x, y, *p, r, g, b);
- x = next;
- }
- } else {
- for ( char * p = buf; *p; p++ )
- {
- int next = x + screeninfo.charWidths[*p];
- gEngfuncs.pfnDrawCharacter (x, y, *p, r, g, b);
- x = next;
- }
- }
- }
- }
- //////////////////////////////////
- 找到这段代码
- void DrawHudString (int x, int y, int r, int g, int b, const char *fmt, ... )
- {
- va_list va_alist;
- char buf[256];
- va_start (va_alist, fmt);
- _vsnprintf (buf, sizeof(buf), fmt, va_alist);
- va_end (va_alist);
- if(cvar.confont)
- {
- DrawSetTextColorEx(/*(float)*/r/255.0,/*(float)*/g/255.0,/*(float)*/b/255.0);
- DrawConsoleStringEx(x,y,buf);
- } else {
- int borderY = displayCenterY*2-18;
- if( y<0 || y>borderY ) { return; }
- bool needSingleCheck=false;
- int borderX = displayCenterX*2-11;
- int drawLen = DrawLen(buf);
- if( x<1 ){ needSingleCheck=true; }
- else
- {
- int maxX = x+drawLen;
- needSingleCheck = (maxX>borderX);
- }
- if( needSingleCheck )
- {
- for ( char * p = buf; *p; p++ )
- {
- int next = x + screeninfo.charWidths[*p];
- if( x>0 && x<borderX )
- gEngfuncs.pfnDrawCharacter (x, y, *p, r, g, b);
- x = next;
- }
- }else {
- for ( char * p = buf; *p; p++ )
- {
- int next = x + screeninfo.charWidths[*p];
- gEngfuncs.pfnDrawCharacter (x, y, *p, r, g, b);
- x = next;
- }
- }
- }
- }
- 改成
- void DrawHudString (int x, int y, int r, int g, int b, const char *fmt, ... )
- {
- va_list va_alist;
- char buf[256];
- va_start (va_alist, fmt);
- _vsnprintf (buf, sizeof(buf), fmt, va_alist);
- va_end (va_alist);
- if(cvar.confont)
- {
- gEngfuncs.pfnDrawSetTextColor(/*(float)*/r/255.0,/*(float)*/g/255.0,/*(float)*/b/255.0);
- gEngfuncs.pfnDrawConsoleString(x,y,buf);
- } else {
- int borderY = displayCenterY*2-18;
- if( y<0 || y>borderY ) { return; }
- bool needSingleCheck=false;
- int borderX = displayCenterX*2-11;
- int drawLen = DrawLen(buf);
- if( x<1 ){ needSingleCheck=true; }
- else
- {
- int maxX = x+drawLen;
- needSingleCheck = (maxX>borderX);
- }
- if( needSingleCheck )
- {
- for ( char * p = buf; *p; p++ )
- {
- int next = x + screeninfo.charWidths[*p];
- if( x>0 && x<borderX )
- gEngfuncs.pfnDrawCharacter (x, y, *p, r, g, b);
- x = next;
- }
- }else {
- for ( char * p = buf; *p; p++ )
- {
- int next = x + screeninfo.charWidths[*p];
- gEngfuncs.pfnDrawCharacter (x, y, *p, r, g, b);
- x = next;
- }
- }
- }
- }
- //////////////////////////////////////
- 还有这段
- int Initialize (cl_enginefunc_t *pEnginefuncs, int iVersion)
- {
- assert(pEnginefuncs);
- memcpy (&gEngfuncs, pEnginefuncs, sizeof(cl_enginefunc_t));
- memcpy (&gHookedEngfuncs, pEnginefuncs, sizeof(cl_enginefunc_t));
- gHookedEngfuncs.pfnSPR_Set = SPR_Set;
- gHookedEngfuncs.pfnSPR_DrawHoles = SPR_DrawHoles;
- gHookedEngfuncs.pfnSPR_DrawAdditive = SPR_DrawAdditive;
- gHookedEngfuncs.pfnSPR_Draw = SPR_Draw;
- gHookedEngfuncs.pfnSPR_Load = SPR_Load;
- // gHookedEngfuncs.pfnDrawCharacter = DrawCharacter;
- // gHookedEngfuncs.pfnDrawConsoleString = DrawConsoleStringEx;
- // gHookedEngfuncs.pfnDrawSetTextColor = DrawSetTextColorEx;
- gHookedEngfuncs.pfnDrawConsoleStringLen = DrawConsoleStringLenEx;
- gHookedEngfuncs.pfnFillRGBA = FillRGBA;
- gHookedEngfuncs.pfnHookUserMsg = HookUserMsg;
- gHookedEngfuncs.pfnHookEvent = HookEvent;
- keyBindManager.con_visible = gEngfuncs.Con_IsVisible;
- int nResult = pInitialize(&gHookedEngfuncs,iVersion);
- static bool firstInitialize = true;
- if(firstInitialize)
- {
- firstInitialize = false;
- srand((unsigned)time(NULL));
- keyBindManager.init();
- keyBindManager.CallBack_Execute = CB_KeyManager_Exec;
- keyBindManager.CallBack_ConType = CB_KeyManager_ConType;
- keyBindManager.con_visible = gEngfuncs.Con_IsVisible;
-
- gConsole.setcolortag( 'b', 25, 50,250);
- gConsole.setcolortag( 'r',165, 42, 42);
- gConsole.setcolortag( 'g', 82,139,139);
- gConsole.setcolortag( 'w',240,255,255);
- gConsole.setcolortag( 'y', -10,-10,-10);
-
- gConsole.echo("&y\MAX Hook 6.7 \n");
- gConsole.echo("&w\Tweaked: Superstyle \n");
- gConsole.echo("&w\MAX战队 版权所有 \n");
- gConsole.echo("");
- ogcMenu.init(getOgcDirFile("Menu.txt").c_str());
- Init_Command_Interpreter();
- ogc_exec("LBChack");
- cvar.alive_method = 1;
- cmd.exec("wall hide 0;lambert hide 0;nosky hide 0");
- pEnginefuncs->pfnConsolePrint("LBChack 1.0 \n");
- pEnginefuncs->pfnConsolePrint(" \n");
- pEnginefuncs->pfnConsolePrint(" \n");
- detour_S_DynamicSound();
- soundPatch.apply();
- cvar.spec_fix = false;
- me.spread.prcflags = 0;
- me.spread.random_seed = 0;
- me.spread.recoil = 0;
- me.spread.gtime = 0;
- me.spread.prevtime = 0;
- me.spread.brokentime = 0;
- me.spread.spreadvar = 0;
- me.spread.recoiltime = 0;
- me.spread.firing = false;
- }
- return nResult;
- }
- 注意Initialize 不要吓改,可能会引起无法显示路线的问题 所以只删掉了如下三个东东,主要问题可能就出现在他们身上
- // gHookedEngfuncs.pfnDrawCharacter = DrawCharacter;
- // gHookedEngfuncs.pfnDrawConsoleString = DrawConsoleStringEx;
- // gHookedEngfuncs.pfnDrawSetTextColor = DrawSetTextColorEx;
[ 此贴被步惊天在2007-09-09 19:31重新编辑 ]
|