搜索
查看: 2841|回复: 4

形形色色的代码,Rulzy等各位大大帮忙啊!

[复制链接]
发表于 2009-9-17 00:14:19 | 显示全部楼层 |阅读模式 来自 广西柳州
本帖最后由 wwww23 于 2009-9-17 00:26 编辑

这应该是C代码吧,比AMXX代码更难懂,请问怎样设置才能不记录 [NO-sXe-I]玩家记录,谢谢。
引用向段可疑的代码,不知对不对:
void ServerActivate_Post( edict_t *pEdictList, int edictCount, int clientMax ){

        rankBots = (int)csstats_rankbots->value ? true:false;

        for( int i = 1; i <= gpGlobals->maxClients; ++i)
                GET_PLAYER_POINTER_I(i)->Init( i , pEdictList + i );
        RETURN_META(MRES_IGNORED);
}
void CPlayer::Disconnect(){

        if ( ignoreBots(pEdict) || !isModuleActive() ) // ignore if he is bot and bots rank is disabled or module is paused
                return;

        if (rank != 0) // Just a sanity check, FL_FAKECLIENT is notoriously unreliable.
        {
                rank->updatePosition( &life );
        }
               
        rank = 0;
}

void CPlayer::PutInServer(){

        //if ( ignoreBots(pEdict) )
        if ( (int)csstats_rankbots->value == 0 &&
                 IsBot() )
                return;

        restartStats();
        const char* name = STRING(pEdict->v.netname);
        const char* unique = name;
        bool isip = false;
        switch((int)csstats_rank->value) {
        case 1:
                if ( (unique = GETPLAYERAUTHID(pEdict)) == 0 )
                        unique = name; // failed to get authid
                break;
        case 2:
                unique = ip;
                isip = true;
        }
        rank = g_rank.findEntryInRank( unique , name , isip);
}
void CPlayer::saveKill(CPlayer* pVictim, int wweapon, int hhs, int ttk){

        if ( ignoreBots(pEdict,pVictim->pEdict) )
                return;

        if ( pVictim->index == index ){ // killed self
                pVictim->weapons[0].deaths++;
                pVictim->life.deaths++;
                pVictim->weaponsRnd[0].deaths++;       // DEC-Weapon (round) stats
                return;
        }

        pVictim->attackers[index].name = weaponData[wweapon].name;
        pVictim->attackers[index].kills++;
        pVictim->attackers[index].hs += hhs;
        pVictim->attackers[index].tks += ttk;
        pVictim->attackers[0].kills++;
        pVictim->attackers[0].hs += hhs;
        pVictim->attackers[0].tks += ttk;
        pVictim->weapons[pVictim->current].deaths++;
        pVictim->weapons[0].deaths++;
        pVictim->life.deaths++;
       
       
        pVictim->weaponsRnd[pVictim->current].deaths++; // DEC-Weapon (round) stats
        pVictim->weaponsRnd[0].deaths++;                   // DEC-Weapon (round) stats
       
        int vi = pVictim->index;
        victims[vi].name = weaponData[wweapon].name;
        victims[vi].deaths++;
        victims[vi].hs += hhs;
        victims[vi].tks += ttk;
        victims[0].deaths++;
        victims[0].hs += hhs;
        victims[0].tks += ttk;
       
        weaponsRnd[wweapon].kills++;                // DEC-Weapon (round) stats
        weaponsRnd[wweapon].hs += hhs;         // DEC-Weapon (round) stats
        weaponsRnd[wweapon].tks += ttk;     // DEC-Weapon (round) stats
        weaponsRnd[0].kills++;                     // DEC-Weapon (round) stats
        weaponsRnd[0].hs += hhs;              // DEC-Weapon (round) stats
        weaponsRnd[0].tks += ttk;          // DEC-Weapon (round) stats
       
        weapons[wweapon].kills++;
        weapons[wweapon].hs += hhs;
        weapons[wweapon].tks += ttk;
        weapons[0].kills++;
        weapons[0].hs += hhs;
        weapons[0].tks += ttk;
        life.kills++;
        life.hs += hhs;
        life.tks += ttk;
}

void CPlayer::saveHit(CPlayer* pVictim, int wweapon, int ddamage, int bbody){

        if ( ignoreBots(pEdict,pVictim->pEdict) )
                return;

        if ( index == pVictim->index ) return;

        pVictim->attackers[index].hits++;
        pVictim->attackers[index].damage += ddamage;
        pVictim->attackers[index].bodyHits[bbody]++;
        pVictim->attackers[0].hits++;
        pVictim->attackers[0].damage += ddamage;
        pVictim->attackers[0].bodyHits[bbody]++;


        int vi = pVictim->index;
        victims[vi].hits++;
        victims[vi].damage += ddamage;
        victims[vi].bodyHits[bbody]++;
        victims[0].hits++;
        victims[0].damage += ddamage;
        victims[0].bodyHits[bbody]++;

        weaponsRnd[wweapon].hits++;              // DEC-Weapon (round) stats
        weaponsRnd[wweapon].damage += ddamage;    // DEC-Weapon (round) stats
        weaponsRnd[wweapon].bodyHits[bbody]++;   // DEC-Weapon (round) stats
        weaponsRnd[0].hits++;                   // DEC-Weapon (round) stats
        weaponsRnd[0].damage += ddamage;         // DEC-Weapon (round) stats
        weaponsRnd[0].bodyHits[bbody]++;        // DEC-Weapon (round) stats

        weapons[wweapon].hits++;
        weapons[wweapon].damage += ddamage;
        weapons[wweapon].bodyHits[bbody]++;
        weapons[0].hits++;
        weapons[0].damage += ddamage;
        weapons[0].bodyHits[bbody]++;

        life.hits++;
        life.damage += ddamage;
        life.bodyHits[bbody]++;
}


void CPlayer::saveShot(int weapon){

        if ( ignoreBots(pEdict) )
                return;

        victims[0].shots++;
        weapons[weapon].shots++;
        weapons[0].shots++;
        life.shots++;
        weaponsRnd[weapon].shots++;       // DEC-Weapon (round) stats
        weaponsRnd[0].shots++;            // DEC-Weapon (round) stats
}
bool ignoreBots(edict_t *pEnt, edict_t *pOther)
{
        rankBots = (int)csstats_rankbots->value ? true : false;
        if (!rankBots && (pEnt->v.flags & FL_FAKECLIENT || (pOther && pOther->v.flags & FL_FAKECLIENT)))
        {
                return true;
        }

        return false;
}

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
 楼主| 发表于 2009-9-19 06:19:26 | 显示全部楼层 来自 广西柳州
花血本等各位大大帮忙,:call:,先谢谢了
回复

使用道具 举报

发表于 2009-9-20 14:36:14 | 显示全部楼层 来自 北京
……代码里有表情符号,看着头疼
回复

使用道具 举报

 楼主| 发表于 2009-10-5 04:41:13 | 显示全部楼层 来自 广西柳州
没人理,可怜:'(
回复

使用道具 举报

发表于 2010-3-14 19:50:49 | 显示全部楼层 来自 江苏苏州
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表