09-16-2007, 06:18 PM
This code will prevent an HLTV Proxy from being entered into matches while on arena (it already worked in deathmatch):
In disc_arena.cpp (Line 93):
This is what the function CDiscArena::Reset will look like after the code has been added (starting on line 86):
Any HLTV Proxy that connects to a server has the SteamID of HLTV, which makes it easier to distinguish from real players.
In disc_arena.cpp (Line 93):
Code:
if (pPlayer && (pPlayer->m_pCurrentArena == this) && pPlayer->m_bHasDisconnected != TRUE && (stricmp(GETPLAYERAUTHID(pPlayer->edict()), "HLTV") != 0))
This is what the function CDiscArena::Reset will look like after the code has been added (starting on line 86):
Code:
void CDiscArena::Reset( void )
{
// Remove all clients in the queue
for ( int i = 1; i <= gpGlobals->maxClients; i++ )
{
CBasePlayer *pPlayer = (CBasePlayer *)UTIL_PlayerByIndex( i );
if (pPlayer && (pPlayer->m_pCurrentArena == this) && pPlayer->m_bHasDisconnected != TRUE && (stricmp(GETPLAYERAUTHID(pPlayer->edict()), "HLTV") != 0))
{
RemoveClient( pPlayer );
// Move her into spectator mode
//MoveToSpectator( pPlayer );
}
}
m_pPlayerQueue = NULL;
m_iPlayers = 0;
m_flTimeLimitOver = 0;
m_bShownTimeWarning = FALSE;
m_iArenaState = ARENA_WAITING_FOR_PLAYERS;
memset( m_hCombatants, 0, sizeof( m_hCombatants ) );
SetThink( NULL );
pev->nextthink = 0;
}
Any HLTV Proxy that connects to a server has the SteamID of HLTV, which makes it easier to distinguish from real players.