11-22-2004, 05:47 PM
NP. Thanks :thumb:
Code:
//-----------------------------------------------------------------------------
// Purpose: Countdown to the round start
//-----------------------------------------------------------------------------
void CDiscArena::CountDownThink( void )
{
// Freeze everyone until there's 3 seconds to go
if ( m_iSecondsTillStart == 3 )
{
for ( int i = 0; i < (m_iPlayersPerTeam * 2); i++ )
{
//white disc haxxx asm...
// if the player is "dead" during countdown and they are not NULL
CBasePlayer *pPlayer = ((CBasePlayer*)(CBaseEntity*)m_hCombatants[i]);
if( m_hCombatants[i] != NULL && !m_hCombatants[i]->IsAlive() )
{
pPlayer->StopObserver();
pPlayer->Spawn();
// difference in ? m_hCombatants[i]->Spawn();
}
// end hax
if (m_hCombatants[i])
((CBaseEntity*)m_hCombatants[i])->pev->maxspeed = 320;
}
}
m_iSecondsTillStart--;
// Play countdown VOX
if (m_iSecondsTillStart < 5)
{
// Speech
for ( int i = 0; i < (m_iPlayersPerTeam * 2); i++ )
{
if (m_hCombatants[i])
((CBasePlayer*)(CBaseEntity*)m_hCombatants[i])->ClientHearVox( g_szCountDownVox[ m_iSecondsTillStart ] );
}
}
// Send the message to the clients in the arena
for ( int i = 1; i <= gpGlobals->maxClients; i++ )
{
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex( i );
if (pPlayer && (pPlayer->pev->groupinfo & pev->groupinfo) && pPlayer->m_bHasDisconnected != TRUE)
{
MESSAGE_BEGIN( MSG_ONE, gmsgStartRnd, NULL, pPlayer->edict() );
WRITE_BYTE( m_iCurrRound );
WRITE_BYTE( m_iSecondsTillStart );
WRITE_BYTE( 0 );
MESSAGE_END();
}
}
if (m_iSecondsTillStart)
{
pev->nextthink = gpGlobals->time + 1.0;
}
else
{
m_iArenaState = ARENA_BATTLE_IN_PROGRESS;
// Enable powerups
CBaseEntity *pFunc = NULL;
while ((pFunc = UTIL_FindEntityByClassname( pFunc, "item_powerup" )) != NULL)
{
((CDiscwarPowerup*)pFunc)->Enable();
}
pev->nextthink = gpGlobals->time + 1.0;
SetThink( BattleThink );
}
}
//-----------------------------------------------------------------------------
<@Miagi> !8 Am I spamming?
<@ChanServ> Miagi: Yes.
<@Miagi> !8 Should I stop?
<@ChanServ> Miagi: Oh, please, PLEASE, make it stop!
<@ChanServ> Miagi: Yes.
<@Miagi> !8 Should I stop?
<@ChanServ> Miagi: Oh, please, PLEASE, make it stop!