sprite esp

社区服务
高级搜索
猴岛论坛CSGO反恐精英CS作弊器交流讨论sprite esp
发帖 回复
倒序阅读 最近浏览的帖子最近浏览的版块
0个回复

sprite esp

楼层直达
作弊辅导员_h

ZxID:1019634

等级: 元老
定做作弊器
举报 只看楼主 使用道具 楼主   发表于: 2007-07-03 0

SpriteESP ->

--------------------------------------------------------------------------------

For dM specially:

All of this code belongs to tabris but i did fix the errors myself.

What i found out to be the max number of sprites in cs hud.txt (could be more).
Code:
#define MAX_SPRITES 212
Sprite Functions
Code:
typedef struct
{
    char szName[256];
    char szSprite[256];
    HSPRITE hspr;
    wrect_t rc;
    int iRes;
} spriteinfo_t;

typedef struct
{
 
    int iSpritesLoaded;
    spriteinfo_t spriteinfo[MAX_SPRITES];
} spritedata_t;
spritedata_t spritedata;

void LoadSprites(client_sprite_t *pList, int iCount)
{
    int i;
    client_sprite_t *p;
    char buf[512];

    spritedata.iSpritesLoaded = 0;

    if(!pList)
    {
        return;
    }

    p = pList;

    i = iCount;

    while(i-- && p->szName[0] != 0x00 && spritedata.iSpritesLoaded < MAX_SPRITES)
    {
        strncpy(spritedata.spriteinfo[spritedata.iSpritesLoaded].szName, p->szName,MAX_SPRITES);
        strncpy(spritedata.spriteinfo[spritedata.iSpritesLoaded].szSprite, p->szSprite,MAX_SPRITES);

        sprintf(buf, "sprites/%s.spr", p->szSprite);
        spritedata.spriteinfo[spritedata.iSpritesLoaded].hspr = pEngfuncs->pfnSPR_Load(buf);

        memcpy(&(spritedata.spriteinfo[spritedata.iSpritesLoaded].rc), &(p->rc), sizeof(p->rc));
        spritedata.spriteinfo[spritedata.iSpritesLoaded].iRes = p->iRes;

        p++;
        spritedata.iSpritesLoaded++;

    }
}


client_sprite_t* __stdcall hookpfnSPR_GetList(char *psz, int *piCount)
{
    client_sprite_t *ret;

    ret = pEngfuncs->pfnSPR_GetList(psz, piCount);
 client_sprite_t *pList;
    if(!strcmp(psz, "sprites/weapon_knife.txt"))
    {
        int iCount;
        pList = pEngfuncs->pfnSPR_GetList("sprites/hud.txt", &iCount);
  if(pList)
  {
            LoadSprites(pList, iCount);
  }
    }
    return ret;
}

int GetSpriteIndex(char *szName)
{
    int i;

    if(szName[0] == 0x00)
        return -1;

    for(i = 0; i < spritedata.iSpritesLoaded; i++)
    {
        if(spritedata.spriteinfo.iRes == 640)
        {
            if(!strcmp(spritedata.spriteinfo.szName, szName))
            {
                return i;
            }
        }
    }
}
Drawing the sprites.
Code:
char buf[255];
int index;

      if (strstr(gGetWeaponName(ent->curstate.weaponmodel),"nade"))
 { sprintf(buf,"d_grenade"); }
 else if (strstr(gGetWeaponName(ent->curstate.weaponmodel),"c4"))
 { sprintf(buf,"c4"); }
 else if (strstr(gGetWeaponName(ent->curstate.weaponmodel),"mp5"))
 { sprintf(buf,"d_mp5navy"); }
 else if (strstr(gGetWeaponName(ent->curstate.weaponmodel),"shield"))
 { sprintf(buf,"d_skull"); }
 else{ sprintf(buf, "d_%s",gGetWeaponName(ent->curstate.weaponmodel)); }
 
 index = GetSpriteIndex(buf);
      if (cvar.spriteesp)
 {
  if (index != -1)
  {         
   pEngfuncs->pfnSPR_Set(spritedata.spriteinfo[index].hspr, pColor->r,pColor->g,pColor->b); // Get sprite ready
   pEngfuncs->pfnSPR_DrawAdditive(0, vecScreen[0]-10, vecScreen[1]-32, &(spritedata.spriteinfo[index].rc)); // Draw sprite
  }
 }
You can hook pfnSPR_GetList or as i did, i called it once in HUD_REDRAW which worked fine.
Code:
int o = 1; // any value?
hookpfnSPR_GetList("sprites/weapon_knife.txt",&o);

密码被盗,请联系cscheat取回
« 返回列表
发帖 回复