CBaseEntity* CSDKPlayer::EntSelectSpawnPoint() { CBaseEntity *pSpot = NULL; const char *pSpawnPointName = ""; switch( GetTeamNumber() ) { #if defined ( SDK_USE_TEAMS ) case SDK_TEAM_BLUE: { pSpawnPointName = "info_player_blue"; pSpot = g_pLastBlueSpawn; if ( SelectSpawnSpot( pSpawnPointName, pSpot ) ) { g_pLastBlueSpawn = pSpot; } } break; case SDK_TEAM_RED: { pSpawnPointName = "info_player_red"; pSpot = g_pLastRedSpawn; if ( SelectSpawnSpot( pSpawnPointName, pSpot ) ) { g_pLastRedSpawn = pSpot; } } break; #endif // SDK_USE_TEAMS case TEAM_UNASSIGNED: { pSpawnPointName = "info_player_deathmatch"; pSpot = g_pLastDMSpawn; if ( SelectSpawnSpot( pSpawnPointName, pSpot ) ) { g_pLastDMSpawn = pSpot; } } break; case TEAM_SPECTATOR: default: { pSpot = CBaseEntity::Instance( INDEXENT(0) ); } break; } if ( !pSpot ) { Warning( "PutClientInServer: no %s on level\n", pSpawnPointName ); return CBaseEntity::Instance( INDEXENT(0) ); } return pSpot; }
CBaseEntity *CMomentumPlayer::EntSelectSpawnPoint() { CBaseEntity *pStart; pStart = NULL; if (SelectSpawnSpot("info_player_counterterrorist", pStart)) { return pStart; } else if (SelectSpawnSpot("info_player_terrorist", pStart)) { return pStart; } else if (SelectSpawnSpot("info_player_start", pStart)) { return pStart; } else { DevMsg("No valid spawn point found.\n"); return BaseClass::Instance(INDEXENT(0)); } }
CBaseEntity *CMomentumPlayer::EntSelectSpawnPoint() { CBaseEntity *pStart = nullptr; const char *spawns[] = {"info_player_counterterrorist", "info_player_terrorist", "info_player_start"}; for (int i = 0; i < 3; i++) { if (SelectSpawnSpot(spawns[i], pStart)) return pStart; } DevMsg("No valid spawn point found.\n"); return Instance(INDEXENT(0)); }