Raised This Month: $ Target: $400
 0% 

2 c4 at roundstart


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-11-2011 , 04:07   Re: 2 c4 at roundstart
Reply With Quote #3

Only 1 of the 2 c4 should have a player as owner (if pev_owner doesn't work, try m_pPlayer offset).

@Doc-Holiday
Player spawn is called many times, and it's too early to detect c4 ( c4 is given the same frame but after spawn, so, index you get is old c4, by chance new c4 had same index but it is not sure.

Code:
void CHalfLifeMultiplay::RestartRound()
{
    // [ .. ]

    @@ // HLTV Event ( New Round )
    MESSAGE_BEGIN( MSG_SPEC, gmsgHLTV );
        WRITE_BYTE( 0 );                // 0 = all players
        WRITE_BYTE( 100 | 128 );        // 100 health + msg flag
    MESSAGE_END();

    MESSAGE_BEGIN( MSG_SPEC, gmsgHLTV );
        WRITE_BYTE( 0 );                // all players
        WRITE_BYTE( 0 );                // to default FOV value
    MESSAGE_END();

    // [ .. ]
    for ( int i = 1; i <= gpGlobals->maxClients; i++ )
    {
        CBasePlayer *pPlayer = CBasePlayer::Instance( i );
        
        if ( pPlayer && !FNullEnt( pPlayer->edict() ) )
        {
            pPlayer->m_iNumSpawns   = 0;
            pPlayer->m_bTeamChanged = false;
        
            if ( !unknowCall168() )
            {
                pPlayer->SyncRoundTimer();
            }
            
            switch ( m_iTeam )
            {
                case TEAM_CT :
                {
                    if ( !playerOffset222 )
                    {
                        pPlayer->AddAccount( m_iAccountCT, 1 );
                    }
                }
                case TEAM_TERRORIST :
                {
                    m_iNumEscapers++;
                    
                    if ( !playerOffset222 )
                    {
                        pPlayer->AddAccount( m_iAccountTerrorist, 1 );
                    }
                    
                    if ( m_bMapHasEscapeZone )
                    {
                        pPlayer->m_bNotKilled = false;
                    }
                }
            }
            
            if ( m_iTeam != TEAM_UNASSIGNED && m_iTeam != TEAM_SPECTATOR )
            {
                if ( m_bHasC4 )
                {
@@                    pPlayer->DropPlayerItem( "weapon_c4" );
                }
                
@@               pPlayer->RoundRespawn(); // spawns
            }
        }
    }
    
    CleanUpMap();
    
    if ( m_bMapHasBombTarget )
    {
@@        GiveC4(); // after spawns
    }
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:25.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode