您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetGlobalTeam函数代码示例

51自学网 2021-06-01 21:08:42
  C++
这篇教程C++ GetGlobalTeam函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetGlobalTeam函数的典型用法代码示例。如果您正苦于以下问题:C++ GetGlobalTeam函数的具体用法?C++ GetGlobalTeam怎么用?C++ GetGlobalTeam使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetGlobalTeam函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetGlobalTeam

const char * C_PlayerResource::GetTeamName(int index){	C_Team *team = GetGlobalTeam( index );	if ( !team )		return "Unknown";	return team->Get_Name();}
开发者ID:1n73rf4c3,项目名称:source-sdk-2013,代码行数:9,


示例2: GetGlobalTeam

//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------void CTeamplayRules::Precache( void ){	// Call the Team Manager's precaches	for ( int i = 0; i < GetNumberOfTeams(); i++ )	{		CTeam *pTeam = GetGlobalTeam( i );		pTeam->Precache();	}}
开发者ID:KermitAudio,项目名称:MSS,代码行数:12,


示例3: CreateRagdollEntity

void CHL2MP_Player::Event_Killed( const CTakeDamageInfo &info ){    //update damage info with our accumulated physics force    CTakeDamageInfo subinfo = info;    subinfo.SetDamageForce( m_vecTotalBulletForce );#ifdef GE_DLL    // Since we fixed force application, give the ragdoll an extra oomph to emphasize his death    m_vecTotalBulletForce.x *= 2.5f;    m_vecTotalBulletForce.y *= 2.5f;    m_vecTotalBulletForce.z *= 2.0f;#endif    // Note: since we're dead, it won't draw us on the client, but we don't set EF_NODRAW    // because we still want to transmit to the clients in our PVS.    CreateRagdollEntity();#ifndef GE_DLL    DetonateTripmines();#endif    BaseClass::Event_Killed( subinfo );    if ( info.GetDamageType() & DMG_DISSOLVE )    {        if ( m_hRagdoll )        {            m_hRagdoll->GetBaseAnimating()->Dissolve( NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL );        }    }#ifndef GE_DLL    CBaseEntity *pAttacker = info.GetAttacker();    if ( pAttacker )    {        int iScoreToAdd = 1;        if ( pAttacker == this )        {            iScoreToAdd = -1;        }        GetGlobalTeam( pAttacker->GetTeamNumber() )->AddMatchScore( iScoreToAdd );    }#endif    FlashlightTurnOff();    m_lifeState = LIFE_DEAD;    RemoveEffects( EF_NODRAW );	// still draw player body    StopZooming();}
开发者ID:Entropy-Soldier,项目名称:ges-legacy-code,代码行数:54,


示例4: switch

//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------void CTriggerAreaCapture::BreakCapture( bool bNotEnoughPlayers ){	if( m_bCapturing )	{		// Remap team to get first game team = 1		switch ( m_nCapturingTeam - FIRST_GAME_TEAM+1 )		{		case 1: 			m_OnBreakTeam1.FireOutput( this, this );			break;		case 2: 			m_OnBreakTeam2.FireOutput( this, this );			break;		default:			Assert(0);			break;		}		m_BreakOutput.FireOutput(this,this);		m_bCapturing = false;		m_nCapturingTeam = TEAM_UNASSIGNED;		UpdateCappingTeam( TEAM_UNASSIGNED );		if ( bNotEnoughPlayers )		{			IncrementCapAttemptNumber();		}		SetCapTimeRemaining( 0 );		if( m_hPoint )		{			m_hPoint->CaptureEnd();		}		m_OnNumCappersChanged.Set( 0, this, this );		// tell all touching players to stop racking up capture points		CTeam *pTeam = GetGlobalTeam( m_nCapturingTeam );		if ( pTeam )		{			for ( int i=0;i<pTeam->GetNumPlayers();i++ )			{				CBaseMultiplayerPlayer *pPlayer = ToBaseMultiplayerPlayer( pTeam->GetPlayer(i) );				if ( pPlayer && IsTouching( pPlayer ) )				{					pPlayer->StopScoringEscortPoints();									}			}		}	}}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:57,


示例5: Q_snprintf

void CTextureProxy::OnBind( void *pEntity ){	// Bail if no base variable	if ( !m_pBaseTextureVar )		return;	char texture[128];	if (Q_stricmp(m_szTextureType, "hometeamcrest") == 0 && GetGlobalTeam(TEAM_A)->HasCrest())		Q_snprintf(texture, sizeof(texture), "%s/%s/teamcrest", TEAMKITS_PATH, GetGlobalTeam(TEAM_A)->GetFolderName());	else if (Q_stricmp(m_szTextureType, "awayteamcrest") == 0 && GetGlobalTeam(TEAM_B)->HasCrest())		Q_snprintf(texture, sizeof(texture), "%s/%s/teamcrest", TEAMKITS_PATH, GetGlobalTeam(TEAM_B)->GetFolderName());	else		Q_snprintf(texture, sizeof(texture), "%s", m_pDefaultTexture->GetName());	m_pNewTexture = materials->FindTexture(texture, NULL, true);			m_pBaseTextureVar->SetTextureValue(m_pNewTexture);	GetMaterial()->RecomputeStateSnapshots();}
开发者ID:Rahmstein,项目名称:IOS,代码行数:21,


示例6: ChangeTeam

void CSDKPlayer::ChangeTeam( int iTeamNum ){	if ( !GetGlobalTeam( iTeamNum ) )	{		Warning( "CSDKPlayer::ChangeTeam( %d ) - invalid team index./n", iTeamNum );		return;	}	int iOldTeam = GetTeamNumber();	// if this is our current team, just abort	if ( iTeamNum == iOldTeam )		return;		m_bTeamChanged = true;	// do the team change:	BaseClass::ChangeTeam( iTeamNum );	// update client state 	if ( iTeamNum == TEAM_UNASSIGNED )	{		State_Transition( STATE_OBSERVER_MODE );	}	else if ( iTeamNum == TEAM_SPECTATOR )	{		RemoveAllItems( true );				State_Transition( STATE_OBSERVER_MODE );	}	else // active player	{		if ( !IsDead() )		{			// Kill player if switching teams while alive			CommitSuicide();			// add 1 to frags to balance out the 1 subtracted for killing yourself			IncrementFragCount( 1 );		}		if( iOldTeam == TEAM_SPECTATOR )			SetMoveType( MOVETYPE_NONE );//Tony; pop up the class menu if we're using classes, otherwise just spawn.#if defined ( SDK_USE_PLAYERCLASSES )		// Put up the class selection menu.		State_Transition( STATE_PICKINGCLASS );#else		State_Transition( STATE_ACTIVE );#endif	}}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:52,


示例7: GetGlobalTeam

//-----------------------------------------------------------------------------// Purpose: Attach this spawnpoint to it's team//-----------------------------------------------------------------------------void CTeamSpawnPoint::Activate( void ){	BaseClass::Activate();	if ( GetTeamNumber() > 0 && GetTeamNumber() <= MAX_TEAMS )	{		GetGlobalTeam( GetTeamNumber() )->AddSpawnpoint( this );	}	else	{		Warning( "info_player_teamspawn with invalid team number: %d/n", GetTeamNumber() );		UTIL_Remove( this );	}}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:16,


示例8:

Color &C_Team::GetHudKitColor(){	Color *color;	if (GetTeamNumber() == TEAM_HOME || GetTeamNumber() == TEAM_AWAY)		color = &m_pKitInfo->m_HudPrimaryColor;	else		color = &g_ColorGray;	if (GetTeamNumber() == TEAM_AWAY)	{		if (*color == GetGlobalTeam(TEAM_HOME)->GetHudKitColor())		{			color = &m_pKitInfo->m_HudSecondaryColor;			if (*color == GetGlobalTeam(TEAM_HOME)->GetHudKitColor())				color = &g_HudAlternativeColors[m_pKitInfo->m_HudPrimaryColorClass];		}	}	return *color;}
开发者ID:iosoccer,项目名称:iosoccer-game,代码行数:22,


示例9: TeamFortress_TeamGetScoreFrags

//=========================================================================// Return the score/frags of a team, depending on whether TeamFrags is onint TeamFortress_TeamGetScoreFrags(int tno){	CTeam *pTeam = GetGlobalTeam( tno );	if ( pTeam )	{		return pTeam->GetScore();	}	else	{		Assert( false );		return -1;	}}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:15,


示例10: GetGlobalTeam

//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------void CTeamControlPoint::HandleScoring( int iTeam ){	if ( TeamplayRoundBasedRules() && !TeamplayRoundBasedRules()->ShouldScorePerRound() )	{		GetGlobalTeam( iTeam )->AddScore( 1 );		TeamplayRoundBasedRules()->HandleTeamScoreModify( iTeam, 1 );		CTeamControlPointMaster *pMaster = g_hControlPointMasters.Count() ? g_hControlPointMasters[0] : NULL;		if ( pMaster && !pMaster->WouldNewCPOwnerWinGame( this, iTeam ) )		{			CTeamRecipientFilter filter( iTeam );			EmitSound( filter, entindex(), "Hud.EndRoundScored" );		}	}}
开发者ID:xxauroraxx,项目名称:Source.Python,代码行数:18,


示例11: ToSOPlayer

void CNPC_SO_BaseZombie::Event_Killed( const CTakeDamageInfo &info ){	CBaseEntity *pEnt = info.GetAttacker();	if ( pEnt && pEnt->IsPlayer() )	{		CSO_Player *pPlayer = ToSOPlayer( pEnt );		if ( pPlayer )		{			// Give players some credit for killing zombie NPCs			pPlayer->IncrementFragCount( 1 );			GetGlobalTeam( pPlayer->GetTeamNumber() )->AddScore( 1 );		}	}	BaseClass::Event_Killed( info );}
开发者ID:jonnyboy0719,项目名称:situation-outbreak-two,代码行数:16,


示例12: CreateRagdollEntity

void CHL2MP_Player::Event_Killed( const CTakeDamageInfo &info ){	//update damage info with our accumulated physics force	CTakeDamageInfo subinfo = info;	subinfo.SetDamageForce( m_vecTotalBulletForce );	// Note: since we're dead, it won't draw us on the client, but we don't set EF_NODRAW	// because we still want to transmit to the clients in our PVS.	CreateRagdollEntity();	//DHL - Skillet - SLAMs are removed, plus the sound is cheesy at death	//DetonateTripmines();	BaseClass::Event_Killed( subinfo );	if ( info.GetDamageType() & DMG_DISSOLVE )	{		if ( m_hRagdoll )		{			m_hRagdoll->GetBaseAnimating()->Dissolve( NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL );		}	}	CBaseEntity *pAttacker = info.GetAttacker();	if ( pAttacker )	{		int iScoreToAdd = 1;		if ( pAttacker == this )		{			iScoreToAdd = -1;		}		if ( !DHLRules()->IsGameWaiting() ) //DHL		{			GetGlobalTeam( pAttacker->GetTeamNumber() )->AddScore( iScoreToAdd );		}	}	FlashlightTurnOff();	m_lifeState = LIFE_DEAD;	RemoveEffects( EF_NODRAW );	// still draw player body	StopZooming();}
开发者ID:dreckard,项目名称:dhl2,代码行数:47,


示例13: Warning

bool CHL2MP_Player::HandleCommand_JoinTeam( int team ){#ifndef GE_DLL    if ( !GetGlobalTeam( team ) || team == 0 )    {        Warning( "HandleCommand_JoinTeam( %d ) - invalid team index./n", team );        return false;    }    if ( team == TEAM_SPECTATOR )    {        // Prevent this is the cvar is set        if ( !mp_allowspectators.GetInt() )        {            ClientPrint( this, HUD_PRINTCENTER, "#Cannot_Be_Spectator" );            return false;        }        if ( GetTeamNumber() != TEAM_UNASSIGNED && !IsDead() )        {            m_fNextSuicideTime = gpGlobals->curtime;	// allow the suicide to work            CommitSuicide();            // add 1 to frags to balance out the 1 subtracted for killing yourself            IncrementFragCount( 1 );        }        ChangeTeam( TEAM_SPECTATOR );        return true;    }    else    {        StopObserverMode();        State_Transition(STATE_ACTIVE);    }    // Switch their actual team...    ChangeTeam( team );    return true;#else    return false;#endif}
开发者ID:Entropy-Soldier,项目名称:ges-legacy-code,代码行数:46,


示例14: GetReplayStartTime

void CReplayManager::AddMatchEvent(match_event_t type, int team, CSDKPlayer *pPlayer1, CSDKPlayer *pPlayer2/* = NULL*/, CSDKPlayer *pPlayer3/* = NULL*/){	MatchEvent *pMatchEvent = new MatchEvent;	if (type == MATCH_EVENT_GOAL || type == MATCH_EVENT_OWNGOAL || type == MATCH_EVENT_MISS || type == MATCH_EVENT_KEEPERSAVE || type == MATCH_EVENT_REDCARD)	{		float replayStartTime = GetReplayStartTime() + 1.0f;		for (int i = 0; i < m_Snapshots.Count(); i++)		{			if (m_Snapshots[i]->snaptime >= replayStartTime)			{				pMatchEvent->snapshots.AddToTail(m_Snapshots[i]);				m_Snapshots[i]->replayCount += 1;			}		}		pMatchEvent->snapshotEndTime = gpGlobals->curtime + 1.0f;	}	else		pMatchEvent->snapshotEndTime = 0;		pMatchEvent->matchPeriod = SDKGameRules()->State_Get();	pMatchEvent->matchEventType = type;	pMatchEvent->second = SDKGameRules()->GetMatchDisplayTimeSeconds();	pMatchEvent->team = team;	pMatchEvent->atMinGoalPos = GetMatchBall()->GetPos().y < SDKGameRules()->m_vKickOff.GetY();	pMatchEvent->pPlayer1Data = pPlayer1 ? pPlayer1->GetPlayerData() : NULL;	pMatchEvent->pPlayer2Data = pPlayer2 ? pPlayer2->GetPlayerData() : NULL;	pMatchEvent->pPlayer3Data = pPlayer3 ? pPlayer3->GetPlayerData() : NULL;	m_MatchEvents.AddToTail(pMatchEvent);	if (type == MATCH_EVENT_GOAL || type == MATCH_EVENT_OWNGOAL || type == MATCH_EVENT_YELLOWCARD || type == MATCH_EVENT_SECONDYELLOWCARD || type == MATCH_EVENT_REDCARD)	{		char matchEventPlayerNames[MAX_MATCH_EVENT_PLAYER_NAME_LENGTH] = {};		if (pPlayer1 && !pPlayer2 && !pPlayer3)			Q_strncpy(matchEventPlayerNames, UTIL_VarArgs("%s", pPlayer1->GetPlayerName()), MAX_MATCH_EVENT_PLAYER_NAME_LENGTH);		else if (pPlayer1 && pPlayer2 && !pPlayer3)			Q_strncpy(matchEventPlayerNames, UTIL_VarArgs("%.15s (%.15s)", pPlayer1->GetPlayerName(), pPlayer2->GetPlayerName()), MAX_MATCH_EVENT_PLAYER_NAME_LENGTH);		else if (pPlayer1 && pPlayer2 && pPlayer3)			Q_strncpy(matchEventPlayerNames, UTIL_VarArgs("%.10s (%.10s, %.10s)", pPlayer1->GetPlayerName(), pPlayer2->GetPlayerName(), pPlayer3->GetPlayerName()), MAX_MATCH_EVENT_PLAYER_NAME_LENGTH);		GetGlobalTeam(pMatchEvent->team)->AddMatchEvent(pMatchEvent->matchPeriod, pMatchEvent->second, pMatchEvent->matchEventType, matchEventPlayerNames);	}}
开发者ID:rain2372,项目名称:IOS-1,代码行数:46,


示例15: CreateRagdollEntity

void CHL2MP_Player::Event_Killed( const CTakeDamageInfo &info ){	//update damage info with our accumulated physics force	CTakeDamageInfo subinfo = info;	subinfo.SetDamageForce( m_vecTotalBulletForce );	//BP empêche de créer un ragdoll si on change de team en mode spectateur	if(GetTeamNumber() != TEAM_SPECTATOR)		CreateRagdollEntity();	BaseClass::Event_Killed( subinfo );	if ( info.GetDamageType() & DMG_DISSOLVE )		if ( m_hRagdoll )			m_hRagdoll->GetBaseAnimating()->Dissolve( NULL, gpGlobals->curtime, false, ENTITY_DISSOLVE_NORMAL );	CBaseEntity *pAttacker = info.GetAttacker();	if ( pAttacker )	{		int iScoreToAdd = 1;		if ( pAttacker == this)		{			if(HL2MPRules()->GetGameType() == GAME_TDM)				iScoreToAdd = 0;			else				iScoreToAdd = -1;		}		if((HL2MPRules()->GetGameType() == GAME_FORTS) || (HL2MPRules()->GetGameType() == GAME_PUSH))			iScoreToAdd = 0;		GetGlobalTeam( pAttacker->GetTeamNumber() )->AddScore( iScoreToAdd );	}	FlashlightTurnOff();	m_lifeState = LIFE_DEAD;	RemoveEffects( EF_NODRAW );	// still draw player body	StopZooming();	DetonateTripmines();//BP enregistre le tueur	SetKiller(info.GetAttacker());}
开发者ID:Orygin,项目名称:BisounoursParty,代码行数:45,


示例16: CheckObserverSettings

void CSDKPlayer::State_Enter_OBSERVER_MODE(){	// Always start a spectator session in roaming mode	m_iObserverLastMode = OBS_MODE_ROAMING;	if( m_hObserverTarget == NULL )	{		// find a new observer target		CheckObserverSettings();	}	// Change our observer target to the nearest teammate	CTeam *pTeam = GetGlobalTeam( GetTeamNumber() );	CBasePlayer *pPlayer;	Vector localOrigin = GetAbsOrigin();	Vector targetOrigin;	float flMinDist = FLT_MAX;	float flDist;	for ( int i=0;i<pTeam->GetNumPlayers();i++ )	{		pPlayer = pTeam->GetPlayer(i);		if ( !pPlayer )			continue;		if ( !IsValidObserverTarget(pPlayer) )			continue;		targetOrigin = pPlayer->GetAbsOrigin();		flDist = ( targetOrigin - localOrigin ).Length();		if ( flDist < flMinDist )		{			m_hObserverTarget.Set( pPlayer );			flMinDist = flDist;		}	}	StartObserverMode( m_iObserverLastMode );	PhysObjectSleep();}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:44,


示例17:

bool CHL2MP_Player::HandleCommand_JoinTeam( int team ){	if ( !GetGlobalTeam( team ) || team == 0 )	{		Warning( "HandleCommand_JoinTeam( %d ) - invalid team index./n", team );		return false;	}	if ( team == TEAM_SPECTATOR )	{		// Prevent this is the cvar is set		if ( !mp_allowspectators.GetInt() )		{			ClientPrint( this, HUD_PRINTCENTER, "#Cannot_Be_Spectator" );			return false;		}		if ( /*GetTeamNumber() != TEAM_UNASSIGNED &&*/ !IsDead() ) //DHL - Skillet - Players in deathmatch are unassigned		{			m_fNextSuicideTime = gpGlobals->curtime;	// allow the suicide to work			CommitSuicide();			// add 1 to frags to balance out the 1 subtracted for killing yourself			IncrementFragCount( 1 );			GetTeam()->AddScore( 1 ); //DHL - Skillet - Required to keep the scoreboard headers from getting out of sync		}		ChangeTeam( TEAM_SPECTATOR );		return true;	}	else	{		StopObserverMode();		State_Transition(STATE_ACTIVE);	}	// Switch their actual team...	ChangeTeam( team );	return true;}
开发者ID:dreckard,项目名称:dhl2,代码行数:43,


示例18: TeamFortress_TeamShowScores

// Display all the Team Scoresvoid TeamFortress_TeamShowScores(BOOL bLong, CBasePlayer *pPlayer){	for (int i = 1; i < g_Teams.Count(); i++)	{		if (!bLong)		{			// Dump short scores			UTIL_ClientPrintAll( HUD_PRINTNOTIFY, UTIL_VarArgs("%s: %d/n", g_szTeamColors[i], GetGlobalTeam(i)->GetScore()) );		}		else		{			// Dump long scores			if (pPlayer == NULL)				UTIL_ClientPrintAll( HUD_PRINTNOTIFY, UTIL_VarArgs("Team %d (%s): %d/n", i, g_szTeamColors[i], GetGlobalTeam(i)->GetScore()) );			else // Print to just one client				ClientPrint( pPlayer, HUD_PRINTNOTIFY,  UTIL_VarArgs("Team %d (%s): %d/n", i, g_szTeamColors[i], GetGlobalTeam(i)->GetScore()) );		}	}}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:20,


示例19: GetGlobalTeam

//-----------------------------------------------------------------------------------------------------int CFuncNavBlocker::DrawDebugTextOverlays( void ){	int offset = BaseClass::DrawDebugTextOverlays();	if (m_debugOverlays & OVERLAY_TEXT_BIT) 	{		CFmtStr str;		// FIRST_GAME_TEAM skips TEAM_SPECTATOR and TEAM_UNASSIGNED, so we can print		// useful team names in a non-game-specific fashion.		for ( int i=FIRST_GAME_TEAM; i<FIRST_GAME_TEAM + MAX_NAV_TEAMS; ++i )		{			if ( IsBlockingNav( i ) )			{				CTeam *team = GetGlobalTeam( i );				if ( team )				{					EntityText( offset++, str.sprintf( "blocking team %s", team->GetName() ), 0 );				}				else				{					EntityText( offset++, str.sprintf( "blocking team %d", i ), 0 );				}			}		}		NavAreaCollector collector( true );		Extent extent;		extent.Init( this );		TheNavMesh->ForAllAreasOverlappingExtent( collector, extent );		for ( int i=0; i<collector.m_area.Count(); ++i )		{			CNavArea *area = collector.m_area[i];			Extent areaExtent;			area->GetExtent( &areaExtent );			debugoverlay->AddBoxOverlay( vec3_origin, areaExtent.lo, areaExtent.hi, vec3_angle, 0, 255, 0, 10, NDEBUG_PERSIST_TILL_NEXT_SERVER );		}	}	return offset;}
开发者ID:WootsMX,项目名称:InSource,代码行数:43,


示例20: GetGlobalTeam

void CSF132FlagBase::OnScore(){	CTeam *pTeam = GetGlobalTeam((GetTeamNumber() == SDK_TEAM_RED) ? SDK_TEAM_BLUE : SDK_TEAM_RED);	if ( !pTeam )	{		Error( "Flag has no team" );	}	pTeam->AddCapturePoints( FLAG_CLASSIC_CAPTURE_POINTS );	switch( GetTeamNumber() )	{		case SDK_TEAM_BLUE:			PlaySound( FLAG_RED_SCORE );			break;		case SDK_TEAM_RED:			PlaySound( FLAG_BLUE_SCORE );			break;	}}
开发者ID:hekar,项目名称:luminousforts-2013,代码行数:21,


示例21: GetTeamNumber

void CHL1MP_Player::SetPlayerTeamModel( void ){	int iTeamNum = GetTeamNumber();	if ( iTeamNum <= TEAM_SPECTATOR )		return;	CTeam * pTeam = GetGlobalTeam( iTeamNum );	char szModelName[256];	Q_snprintf( szModelName, 256, "%s%s/%s.mdl", s_szModelPath, pTeam->GetName(), pTeam->GetName() );    // Check to see if the model was properly precached, do not error out if not.    int i = modelinfo->GetModelIndex( szModelName );    if ( i == -1 )    {        Warning("Model %s does not exist./n", szModelName );        return;    }        	SetModel( szModelName );	m_flNextModelChangeTime = gpGlobals->curtime + 5;}
开发者ID:AgentAgrimar,项目名称:source-sdk-trilogy,代码行数:23,


示例22: GetGlobalTeam

//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------void CDoDHudHealth::OnThink(){	BaseClass::OnThink();	C_DODPlayer *pPlayer = C_DODPlayer::GetLocalDODPlayer();	if ( pPlayer )	{		int nTeam = pPlayer->GetTeamNumber();		if ( nTeam == TEAM_ALLIES || nTeam == TEAM_AXIS )		{			C_DODTeam *pTeam = dynamic_cast<C_DODTeam *>( GetGlobalTeam( nTeam ) );			C_DOD_PlayerResource *dod_PR = dynamic_cast<C_DOD_PlayerResource *>( g_PR );			int nClass = dod_PR->GetPlayerClass( GetLocalPlayerIndex() );			if ( nClass != PLAYERCLASS_UNDEFINED )			{				if ( ( nClass != m_nPrevClass ) ||					( nTeam != TEAM_INVALID && ( nTeam == TEAM_AXIS || nTeam == TEAM_ALLIES ) && nTeam != m_nPrevTeam ) )				{					m_nPrevClass = nClass;					m_nPrevTeam = nTeam;					if ( m_pClassImage )					{						m_pClassImage->SetImage( ( pTeam->GetPlayerClassInfo( nClass ) ).m_szClassHealthImage );					}					if ( m_pClassImageBG )					{						m_pClassImageBG->SetImage( ( pTeam->GetPlayerClassInfo( nClass ) ).m_szClassHealthImageBG );					}				}			}		}	}}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:40,


示例23: ChangeTeam

//-----------------------------------------------------------------------------// Purpose: // Input  : *pTeam - //-----------------------------------------------------------------------------void CObjectResupply::ChangeTeam( int iTeamNum ){	CTFTeam *pExisting = (CTFTeam*)GetTeam();	CTFTeam *pTeam = (CTFTeam*)GetGlobalTeam( iTeamNum );	// Already on this team	if ( GetTeamNumber() == iTeamNum )		return;	if ( pExisting )	{		// Remove it from current team ( if it's in one ) and give it to new team		pExisting->RemoveResupply( this );	}			// Change to new team	BaseClass::ChangeTeam( iTeamNum );		// Add this object to the team's list	if (pTeam)	{		pTeam->AddResupply( this );	}}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:28,


示例24: return

//-----------------------------------------------------------------------------// Purpose: Get a pointer to the specified TF team manager//-----------------------------------------------------------------------------CBliinkTeam *GetGlobalSDKTeam( int iIndex ){	return (CBliinkTeam*)GetGlobalTeam( iIndex );}
开发者ID:Randdalf,项目名称:bliink,代码行数:7,


示例25: ToSDKPlayer

//.........这里部分代码省略.........		m_CountryIndices.Set(i, pPl->GetCountryIndex());		m_NationalityIndices.Set(i, pPl->GetNationalityIndex());		m_szClubNames.Set(i, MAKE_STRING(pPl->GetClubName()));		m_szNationalTeamNames.Set(i, MAKE_STRING(pPl->GetNationalTeamName()));		m_szShirtNames.Set(i, MAKE_STRING(pPl->GetShirtName()));		// We're dealing with arrays of char pointers which point to the char array of the player object variable.		// Keep track of variable changes with a boolean variable so we know when to send an update to the clients.		if (pPl->m_bPlayerNameChanged)		{			m_szPlayerNames.GetForModify(i);			pPl->m_bPlayerNameChanged = false;		}		if (pPl->m_bClubNameChanged)		{			m_szClubNames.GetForModify(i);			pPl->m_bClubNameChanged = false;		}		if (pPl->m_bNationalTeamNameChanged)		{			m_szNationalTeamNames.GetForModify(i);			pPl->m_bNationalTeamNameChanged = false;		}		if (pPl->m_bShirtNameChanged)		{			m_szShirtNames.GetForModify(i);			pPl->m_bShirtNameChanged = false;		}		// Don't update statistics every time		if (m_nUpdateCounter % 20 == 0)		{			// update ping all 20 think ticks = (20*0.1=2seconds)			int ping, packetloss;			UTIL_GetPlayerConnectionInfo( i, ping, packetloss );			// calc avg for scoreboard so it's not so jittery			ping = 0.8f * m_iPing.Get(i) + 0.2f * ping;			m_iPing.Set( i, ping );			// m_iPacketloss.Set( i, packetloss );			m_RedCards.Set(i, max( 0, pPl->GetRedCards() ) );			m_YellowCards.Set(i, max( 0, pPl->GetYellowCards() ) );			m_Fouls.Set(i, max( 0, pPl->GetFouls() ) );			m_FoulsSuffered.Set(i, max( 0, pPl->GetFoulsSuffered() ) );			m_SlidingTackles.Set(i, max( 0, pPl->GetSlidingTackles() ) );			m_SlidingTacklesCompleted.Set(i, max( 0, pPl->GetSlidingTacklesCompleted() ) );			m_GoalsConceded.Set(i, max( 0, pPl->GetGoalsConceded() ) );			m_Shots.Set(i, max( 0, pPl->GetShots() ) );			m_ShotsOnGoal.Set(i, max( 0, pPl->GetShotsOnGoal() ) );			m_PassesCompleted.Set(i, max( 0, pPl->GetPassesCompleted() ) );			m_Interceptions.Set(i, max( 0, pPl->GetInterceptions() ) );			m_Offsides.Set(i, max( 0, pPl->GetOffsides() ) );			m_Goals.Set(i, max( 0, pPl->GetGoals() ) );			m_OwnGoals.Set(i, max( 0, pPl->GetOwnGoals() ) );			m_Assists.Set(i, max( 0, pPl->GetAssists() ) );			m_Possession.Set(i, max( 0, pPl->GetPossession() ) );			m_DistanceCovered.Set(i, max( 0, pPl->GetDistanceCovered() ) );			m_Passes.Set(i, max( 0, pPl->GetPasses() ) );			m_FreeKicks.Set(i, max( 0, pPl->GetFreeKicks() ) );			m_Penalties.Set(i, max( 0, pPl->GetPenalties() ) );			m_Corners.Set(i, max( 0, pPl->GetCorners() ) );			m_ThrowIns.Set(i, max( 0, pPl->GetThrowIns() ) );			m_KeeperSaves.Set(i, max( 0, pPl->GetKeeperSaves() ) );			m_KeeperSavesCaught.Set(i, max( 0, pPl->GetKeeperSavesCaught() ) );			m_GoalKicks.Set(i, max( 0, pPl->GetGoalKicks() ) );			//m_Ratings.Set(i, max( 0, pPl->GetRating() ) );			m_Ratings.Set(i, 100 );			if (pPl->GetTeamNumber() == TEAM_HOME || pPl->GetTeamNumber() == TEAM_AWAY)			{				int ti = pPl->GetTeamNumber() - TEAM_HOME;				if (ping > 0)				{					pingSum[ti] += ping;					pingPlayers[ti] += 1;				}			}		}	}	for (int team = TEAM_HOME; team <= TEAM_AWAY; team++)	{		int ti = team - TEAM_HOME;		CTeam *pTeam = GetGlobalTeam(team);		if (m_nUpdateCounter % 20 == 0)		{			pTeam->m_Ping = pingSum[ti] / max(1, pingPlayers[ti]);			pTeam->m_Rating = 100;		}	}}
开发者ID:ziming,项目名称:IOS,代码行数:101,


示例26: Warning

void CHL2MPRules::RestartGame(){    // bounds check    if ( mp_timelimit.GetInt() < 0 )    {        mp_timelimit.SetValue( 0 );    }    m_flGameStartTime = gpGlobals->curtime;    if ( !IsFinite( m_flGameStartTime.Get() ) )    {        Warning( "Trying to set a NaN game start time/n" );        m_flGameStartTime.GetForModify() = 0.0f;    }    CleanUpMap();    // now respawn all players    for (int i = 1; i <= gpGlobals->maxClients; i++ )    {        CHL2MP_Player *pPlayer = (CHL2MP_Player*) UTIL_PlayerByIndex( i );        if ( !pPlayer )            continue;        if ( pPlayer->GetActiveWeapon() )        {            pPlayer->GetActiveWeapon()->Holster();        }        pPlayer->RemoveAllItems( true );        respawn( pPlayer, false );        pPlayer->Reset();    }    // Respawn entities (glass, doors, etc..)    CTeam *pRebels = GetGlobalTeam( TEAM_REBELS );    CTeam *pCombine = GetGlobalTeam( TEAM_COMBINE );    if ( pRebels )    {        pRebels->SetScore( 0 );    }    if ( pCombine )    {        pCombine->SetScore( 0 );    }    m_flIntermissionEndTime = 0;    m_flRestartGameTime = 0.0;    m_bCompleteReset = false;    IGameEvent * event = gameeventmanager->CreateEvent( "round_start" );    if ( event )    {        event->SetInt("fraglimit", 0 );        event->SetInt( "priority", 6 ); // HLTV event priority, not transmitted        event->SetString("objective","DEATHMATCH");        gameeventmanager->FireEvent( event );    }}
开发者ID:whztt07,项目名称:halflife-vr,代码行数:63,


示例27: switch

//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------void CTriggerAreaCapture::BreakCapture( bool bNotEnoughPlayers ){	if( m_bCapturing )	{		// Remap team to get first game team = 1		switch ( m_nCapturingTeam - FIRST_GAME_TEAM+1 )		{		case 1: 			m_OnBreakTeam1.FireOutput( this, this );			break;		case 2: 			m_OnBreakTeam2.FireOutput( this, this );			break;		default:			Assert(0);			break;		}		m_BreakOutput.FireOutput(this,this);		m_bCapturing = false;		m_nCapturingTeam = TEAM_UNASSIGNED;		UpdateCappingTeam( TEAM_UNASSIGNED );		if ( bNotEnoughPlayers )		{			IncrementCapAttemptNumber();		}		SetCapTimeRemaining( 0 );		if( m_hPoint )		{			m_hPoint->CaptureEnd();			// The point reverted to it's previous owner.			IGameEvent *event = gameeventmanager->CreateEvent( "teamplay_capture_broken" );			if ( event )			{				event->SetInt( "cp", m_hPoint->GetPointIndex() );				event->SetString( "cpname", m_hPoint->GetName() );				event->SetFloat( "time_remaining", m_fTimeRemaining );				gameeventmanager->FireEvent( event );			}		}		SetNumCappers( 0 );		// tell all touching players to stop racking up capture points		CTeam *pTeam = GetGlobalTeam( m_nCapturingTeam );		if ( pTeam )		{			for ( int i=0;i<pTeam->GetNumPlayers();i++ )			{				CBaseMultiplayerPlayer *pPlayer = ToBaseMultiplayerPlayer( pTeam->GetPlayer(i) );				if ( pPlayer && IsTouching( pPlayer ) )				{					pPlayer->StopScoringEscortPoints();									}			}		}	}}
开发者ID:Baer42,项目名称:Source-SDK-2014,代码行数:67,


示例28: IncrementCapAttemptNumber

//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------void CTriggerAreaCapture::EndCapture( int team ){	IncrementCapAttemptNumber();	// Remap team to get first game team = 1	switch ( team - FIRST_GAME_TEAM+1 )	{	case 1: 		m_OnCapTeam1.FireOutput( this, this );		break;	case 2: 		m_OnCapTeam2.FireOutput( this, this );		break;	default:		Assert(0);		break;	}	m_CapOutput.FireOutput(this,this);	int numcappers = 0;	int cappingplayers[MAX_AREA_CAPPERS];	GetNumCappingPlayers( team, numcappers, cappingplayers );	// Handle this before we assign the new team as the owner of this area	HandleRespawnTimeAdjustments( m_nOwningTeam, team );			m_nOwningTeam = team;	m_bCapturing = false;	m_nCapturingTeam = TEAM_UNASSIGNED;	SetCapTimeRemaining( 0 );	//there may have been more than one capper, but only report this one.	//he hasn't gotten points yet, and his name will go in the cap string if its needed	//first capper gets name sent and points given by flag.	//other cappers get points manually above, no name in message	//send the player in the cap string	if( m_hPoint )	{		OnEndCapture( m_nOwningTeam );		UpdateOwningTeam();		m_hPoint->SetOwner( m_nOwningTeam, true, numcappers, cappingplayers );		m_hPoint->CaptureEnd();	}	SetNumCappers( 0 );	// tell all touching players to stop racking up capture points	CTeam *pTeam = GetGlobalTeam( m_nCapturingTeam );	if ( pTeam )	{		for ( int i=0;i<pTeam->GetNumPlayers();i++ )		{			CBaseMultiplayerPlayer *pPlayer = ToBaseMultiplayerPlayer( pTeam->GetPlayer(i) );			if ( pPlayer && IsTouching( pPlayer ) )			{					pPlayer->StopScoringEscortPoints();								}		}	}	// play any special cap sounds	if ( TeamplayRoundBasedRules() )	{		TeamplayRoundBasedRules()->PlaySpecialCapSounds( m_nOwningTeam );	}}
开发者ID:Baer42,项目名称:Source-SDK-2014,代码行数:73,



注:本文中的GetGlobalTeam函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GetGraph函数代码示例
C++ GetGlobalColor函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。