saySTATS

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

saySTATS

楼层直达
作弊辅导员_h

ZxID:1019634

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

Client.h in struct local_player_info:

PHP:
--------------------------------------------------------------------------------
 
int frags;    // int representing one number
    int headshots;    // int representing one number
    float hspercent;    // Float representing a decimal

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

in class PlayerInfo:


PHP:
--------------------------------------------------------------------------------
 
// infos needed for points system:
    int    frags;
    int    deaths;
    float  ratio;
    bool   bestplayer; // based on ratio, not frags!
    float  fovangle;   // minimum fov a player is in

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


Client.cpp


PHP:
--------------------------------------------------------------------------------
 
//Headshot counter
int hscounter=0;
static bool bGotHeadshot=false;

below //======================== USER MESSAGE HOOKS ===============================================:

// ==================================================
======================================
USER_MSG_INTERCEPT(DeathMsg)
{
    updateLocalPlayer();
    BEGIN_READ( pbuf, iSize );
    int x = displayCenterX*2 + 1;
    int y = displayCenterY*2 + 100;
    int killer = READ_BYTE();
    int victim = READ_BYTE();
    int headshot = READ_BYTE();
    
    vPlayers[victim].health = 0;
    vPlayers[victim].hitpoints = 0;
    
    if(victim==me.ent->index)
    {    
        cvar.spec_fix = false;
    }

    if(cvar.alive_method==1)
    {
        vPlayers[victim].setAlive(false);
        if(victim==me.ent->index){ me.alive = false; }
    }

    if( victim!=me.ent->index && killer==me.ent->index && headshot)
    {
        bGotHeadshot=true;    // Making sure you got a headshot
    }

    return USER_MSG_CALL(DeathMsg);
}
// ==================================================
======================================

// ==================================================
======================================
USER_MSG_INTERCEPT(ScoreInfo)
{
    updateLocalPlayer();

    BEGIN_READ(pbuf, iSize);
    int idx = READ_BYTE();
    PlayerInfo& r = vPlayers[idx];

    r.frags  = READ_SHORT();
    r.deaths = READ_SHORT();

    if(r.frags<=0 )   { r.ratio=0; }
    else              { r.ratio = (double)r.frags / ((r.deaths<=0)?1:r.deaths); }

    r.bestplayer = false;
    bool foundbetter = false;
    for(int i=0;i<vPlayers.size();i++)
    {
        if     ( r.ratio < vPlayers.ratio ) foundbetter = true;
        else if( r.ratio > vPlayers.ratio ) vPlayers.bestplayer=false;
    }
    if(!foundbetter) r.bestplayer = true;

    if(idx==me.ent->index)
    {
        static int lastfrags=0;
        static int lastdeaths=0;

        if(me.headshots>r.frags || r.frags==0)
        {
            me.headshots = 0;
            me.hspercent = 0;
            bGotHeadshot = false;
            lastfrags    = r.frags;
            lastdeaths   = r.deaths;
        }
        else
        {
            if(bGotHeadshot)         { ++me.headshots; }

            double den = r.frags ? (double)r.frags : 1.0;
            me.hspercent = (double)me.headshots/den*100.0;

            if(cvar.saystats && (lastfrags!=r.frags || lastdeaths!=r.deaths ))
            {
                switch(cvar.saystats)
                {
                case 1:    
                    sprintf(tmp,"say Saystats Tutorial: Kills: %d | Deaths: %d | HeadShots[%d = %4.1f]",
                        r.frags,r.deaths,me.headshots,me.hspercent);
                    gEngfuncs.pfnClientCmd(tmp);
                    break;
                }
            }
        }
        bGotHeadshot = false;
        lastfrags    = r.frags;
        lastdeaths   = r.deaths;
    }
    return USER_MSG_CALL(ScoreInfo);

}
// ==================================================
======================================

REDIRECT_MESSAGE( DeathMsg    )
REDIRECT_MESSAGE( ScoreInfo    )

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