添加Hitbox瞄准模式

社区服务
高级搜索
猴岛论坛CSGO反恐精英CS作弊器交流讨论添加Hitbox瞄准模式
发帖 回复
倒序阅读 最近浏览的帖子最近浏览的版块
33个回复

添加Hitbox瞄准模式

楼层直达
莎仕芘亞

ZxID:1171401

等级: 元老
猴岛国防部部长

举报 只看楼主 使用道具 楼主   发表于: 2007-07-24 0
Hitbox


Hitbox
//*** in aimbot.cpp ***//
//*** in aimbot.cpp ***//
//*** in aimbot.cpp ***//

above void OriginAimbot::FindTarget()


Code:
add static bool hitboxloaded = false;
then in void OriginAimbot::FindTarget()
add



Code:
if(hitboxloaded)
{
  cmd.exec("avclear;avadd 0 0 0 0;avadd 1 0 0 0;avadd 2 0 0 0");
}
then find void OriginAimbot::CalcVec_MeToTarget(float *view)
replace it with this


Code:
void OriginAimbot::CalcVec_MeToTarget(float *view)
{
  float EntViewOrg[3];
  CalcTargetSpot(EntViewOrg);
  if(cvar.hitbox)
  {
    VectorCopy(vPlayers[target].vPlayerHead,EntViewOrg);
    hitboxloaded=true;
  } else {
    VectorCopy(EntViewOrg, aim_spot);
    hitboxloaded=false;
  }
  view[0] = EntViewOrg[0] - me.pmEyePos[0];
  view[1] = EntViewOrg[1] - me.pmEyePos[1];
  view[2] = EntViewOrg[2] - me.pmEyePos[2];
}


//*** in client.cpp ***//
//*** in client.cpp ***//
//*** in client.cpp ***//

int ( *OrigStudioDrawPlayer )( int flags, struct entity_state_s *pplayer );
under that put

Code:

void VectorTransform (float *in1, float in2[3][4], float *out)
{
  out[0] = DotProduct(in1, in2[0]) + in2[0][3];
  out[1] = DotProduct(in1, in2[1]) + in2[1][3];
  out[2] = DotProduct(in1, in2[2]) + in2[2][3];
}

void GetHeadPosition(cl_entity_t *pEnt)
{
  typedef float BoneMatrix_t[MAXSTUDIOBONES][3][4];
  model_t *pModel;
  studiohdr_t *pStudioHeader;
  BoneMatrix_t *pBoneMatrix;
  Vector vBBMin = Vector(0, 0, 0);
  Vector vBBMax = Vector(0, 0, 0);
  mstudiobbox_t *pHitbox;
 
  int i;
  local_player_info playerdata[32];
  if(!vPlayers[pEnt->index].bGotHead)
  {
    pModel = IEngineStudio.SetupPlayerModel(pEnt->index);
    pStudioHeader = (studiohdr_t*)IEngineStudio.Mod_Extradata(pModel);
    pBoneMatrix = (BoneMatrix_t*)IEngineStudio.StudioGetBoneTransform();
    pHitbox = (mstudiobbox_t*)((byte*)pStudioHeader + pStudioHeader->hitboxindex);
    int iGroup = cvar.hitbox;
    if (cvar.hitbox > 20) {cvar.hitbox = 11;}
    i = cvar.hitbox;
    if(i)
    { 
      Vector vCubePoints[8];
      Vector vCubePointsTrans[8];
      Vector testvec;
      Vector vNew;
      Vector vOffset;

      VectorTransform(pHitbox.bbmin, (*pBoneMatrix)[pHitbox.bone], vBBMin);
      VectorTransform(pHitbox.bbmax, (*pBoneMatrix)[pHitbox.bone], vBBMax);

      if(i)
      {
        vPlayers[pEnt->index].vPlayerHead = (vBBMax + vBBMin)*0.5f;
        vPlayers[pEnt->index].bGotHead = true;
        vPlayers[pEnt->index].vPlayerHead - vPlayers[pEnt->index].getEnt()->origin;
        Vector vLog = (vPlayers[pEnt->index].vPlayerHead - pEnt->origin);
      }

      vCubePoints[0] = (pHitbox.bbmin);
      vCubePoints[1] = Vector(pHitbox.bbmin.x, pHitbox.bbmax.y, pHitbox.bbmin.z);
      vCubePoints[2] = Vector(pHitbox.bbmax.x, pHitbox.bbmax.y, pHitbox.bbmin.z);
      vCubePoints[3] = Vector(pHitbox.bbmax.x, pHitbox.bbmin.y, pHitbox.bbmin.z);

      vCubePoints[4] = (pHitbox.bbmax);
      vCubePoints[5] = Vector(pHitbox.bbmin.x, pHitbox.bbmax.y, pHitbox.bbmax.z);
      vCubePoints[6] = Vector(pHitbox.bbmin.x, pHitbox.bbmin.y, pHitbox.bbmax.z);
      vCubePoints[7] = Vector(pHitbox.bbmax.x, pHitbox.bbmin.y, pHitbox.bbmax.z);

 
      int iColor = pHitbox.group;
      if (cvar.drawhitbox)
      {
        for(int j = 0; j < 8; j++) { VectorTransform(vCubePoints[j], (*pBoneMatrix)[pHitbox.bone], vCubePointsTrans[j]); }
        glDisable(GL_TEXTURE_2D);
        glEnable(GL_BLEND);
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        glLineWidth(1.5f);
        glBegin(GL_LINE_LOOP);
        glColor4f(1.2f, 0.2f, 0.2f, 1.0f);
        glVertex3fv(vCubePointsTrans[0]);
        glColor4f(0.2f, 1.2f, 0.2f, 1.0f);
        glVertex3fv(vCubePointsTrans[1]);
        glColor4f(0.2f, 0.2f, 1.2f, 1.0f);
        glVertex3fv(vCubePointsTrans[2]);
        glColor4f(0.2f, 1.2f, 1.2f, 1.0f);
        glVertex3fv(vCubePointsTrans[3]);
        glEnd();
        glBegin(GL_LINE_LOOP);
        glColor4f(1.2f, 0.2f, 0.2f, 1.0f);
        glVertex3fv(vCubePointsTrans[4]);
        glColor4f(0.2f, 1.2f, 0.2f, 1.0f);
        glVertex3fv(vCubePointsTrans[5]);
        glColor4f(0.2f, 0.2f, 1.2f, 1.0f);
        glVertex3fv(vCubePointsTrans[6]);
        glColor4f(0.2f, 1.2f, 1.2f, 1.0f);
        glVertex3fv(vCubePointsTrans[7]);
        glEnd();
        glBegin(GL_LINES);
        glVertex3fv(vCubePointsTrans[0]);
        glColor4f(1.2f, 0.2f,0.2f, 1.0f);
        glVertex3fv(vCubePointsTrans[6]);
        glColor4f(0.2f, 1.2f, 0.2f, 1.0f);
        glVertex3fv(vCubePointsTrans[1]);
        glColor4f(0.2f, 0.2f, 1.2f, 1.0f);
        glVertex3fv(vCubePointsTrans[5]);
        glColor4f(0.2f, 1.2f, 1.2f, 1.0f);
        glVertex3fv(vCubePointsTrans[2]);
        glColor4f(1.2f, 0.2f, 0.2f, 1.0f);
        glVertex3fv(vCubePointsTrans[4]);
        glColor4f(0.2f, 1.2f, 0.2f, 1.0f);
        glVertex3fv(vCubePointsTrans[3]);
        glColor4f(0.2f, 0.2f, 1.2f, 1.0f);
        glVertex3fv(vCubePointsTrans[7]);
        glEnd();
        glDisable(GL_BLEND);
        glEnable(GL_TEXTURE_2D);
      }
    }
  }
}


in void PreV_CalcRefdef (struct ref_params_s *pparams)
under for (int ax=0;ax<vPlayers.size();ax++)
add



Code:
vPlayers[ax].bGotHead = false;
//*** in client.h ***//
//*** in client.h ***//
//*** in client.h ***//

At the top add


Code:
#include "engine/cl_entity.h"
under class PlayerInfo in public add


Code:
bool bGotHead;
Vector vPlayerHead;
Then at the very button add


Code:
extern void GetHeadPosition(cl_entity_t *pEnt);
//*** in opengl.cpp ***//
//*** in opengl.cpp ***//
//*** in opengl.cpp ***//


at the top add this


Code:
#include "engine/cl_entity.h"
then under typedef void (APIENTRY *TglRectiFunc) (GLint x, GLint y, GLint x2, GLint y2);
add


Code:
typedef void (APIENTRY *xglPopMatrix) (GLvoid);
then under TglRectiFunc oglRecti = NULL; add


Code:
xglPopMatrix oglPopMatrix=NULL;
above void CheckForOpenGlHook(FARPROC* pProc,LPCTSTR lpProcName)
add


Code:
extern engine_studio_api_s *pstudio;
void APIENTRY pglPopMatrix (GLvoid)
{
  cl_entity_t * pEnt;
  pEnt = pstudio->GetCurrentEntity();
  if(pEnt && pEnt->player)
    GetHeadPosition(pEnt);
  glPopMatrix( );
}
FINALLY LAST STEP!



then at the button of void CheckForOpenGlHook(FARPROC* pProc,LPCTSTR lpProcName)
add


Code:
else
if (!strcmp(lpProcName,"glPopMatrix"))
{
  oglPopMatrix = (xglPopMatrix)*pProc;
  *pProc = (FARPROC)&pglPopMatrix;
}
t_yong

ZxID:1020143

等级: 少校
举报 只看该作者 沙发   发表于: 2007-07-24 0
看不懂
莎仕芘亞

ZxID:1171401

等级: 元老
猴岛国防部部长

举报 只看该作者 板凳   发表于: 2007-07-24 0
这个瞄准模式 很棒的 需要的可以测试一下 呵呵 
maya_h

ZxID:1173941

等级: 新兵
举报 只看该作者 地板   发表于: 2007-07-24 0
呵呵,hitbox瞄准,不知道能不能微调,cn source就可以:)
o14547

ZxID:1189454

等级: 下士
举报 只看该作者 4楼  发表于: 2007-07-24 0
哦??

添加到CPP里还是.......
597173779

ZxID:1256839

等级: 下士
举报 只看该作者 5楼  发表于: 2007-09-03 0
好强啊,一木仓暴头几率70%-100%
cqhts_h

ZxID:1259482

等级: 新兵
举报 只看该作者 6楼  发表于: 2007-09-05 0
强到冷啊
yangmengyu19

ZxID:1251683

等级: 少校
举报 只看该作者 7楼  发表于: 2007-09-05 0
这都什么跟什么啊
z31341135

ZxID:1266256

等级: 新兵
举报 只看该作者 8楼  发表于: 2007-09-16 0
怎么用呀。
我是新来的不懂~?
machuangcccc

ZxID:1258295

等级: 大校
CS中得到快乐是最重要的
举报 只看该作者 9楼  发表于: 2007-09-16 0
教教怎么用吧?
bc2233

ZxID:1117102

等级: 中尉
举报 只看该作者 10楼  发表于: 2007-09-18 0
部长我看不懂哦`
可以教下我吗`?加我Q510652334
  谢谢你了哈部长
bc2233

ZxID:1117102

等级: 中尉
举报 只看该作者 11楼  发表于: 2007-09-18 0
510652335
niecaichen

ZxID:1272707

等级: 大尉
举报 只看该作者 12楼  发表于: 2007-09-27 0
看不明白 上面的代码是制造作弊的吗
xhppbfxx

ZxID:1273555

等级: 新兵
举报 只看该作者 13楼  发表于: 2007-09-28 0
qiu123456_h

ZxID:1083590

等级: 新兵
举报 只看该作者 14楼  发表于: 2007-10-13 0
可惜在近距离打不准,怎么样才可以解决呢?楼主要能发个 根据距离自动调整HITBOX瞄准就好了,期待中。。。。。。。。。。
hellgirl

ZxID:1283683

等级: 新兵
举报 只看该作者 15楼  发表于: 2007-10-14 0
哈哈哈 帮忙顶你
jih2021

ZxID:1283984

等级: 列兵
举报 只看该作者 16楼  发表于: 2007-10-15 0
顶你
plmkojh

ZxID:1111489

等级: 少校
抢劫工商银行,实现心中梦想!
举报 只看该作者 17楼  发表于: 2007-10-16 0
●█〓██▄▄▄▄▄▄ ●●●●●● 顶     
▄▅██████▅▄▃▂       
██████████████       
◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲◤ 
我心思☆祢}亦癫→狂╲_/~↘網絡冭虛僞!⺻溡緔⿺帅氣
plmkojh

ZxID:1111489

等级: 少校
抢劫工商银行,实现心中梦想!
举报 只看该作者 18楼  发表于: 2007-10-16 0
●█〓██▄▄▄▄▄▄ ●●●●●● 顶     
▄▅██████▅▄▃▂       
██████████████       
◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲◤ 
我心思☆祢}亦癫→狂╲_/~↘網絡冭虛僞!⺻溡緔⿺帅氣
猴岛顾问

ZxID:1203163

等级: 少尉
举报 只看该作者 19楼  发表于: 2008-04-24 0
hitbox瞄准模式,在瞄准上好像有些问题,偶尔出现瞄准位置错误
« 返回列表
发帖 回复