Пример #1
0
void CHL2MP_Player::SetPlayerTeamModel( void )
{
	const char *szModelName = NULL;
	szModelName = engine->GetClientConVarValue( engine->IndexOfEdict( edict() ), "cl_playermodel" );

	int modelIndex = modelinfo->GetModelIndex( szModelName );

	if ( modelIndex == -1 || ValidatePlayerModel( szModelName ) == false )
	{
		szModelName = "models/player/carebear.mdl";
		m_nSkin = toSkinId(PLAYER_SKIN_ROSE);
		m_iModelType = TEAM_PINK;

		char szReturnString[512];

		Q_snprintf( szReturnString, sizeof (szReturnString ), "cl_playermodel %s\n", szModelName );
		engine->ClientCommand ( edict(), szReturnString );
	}

	if ( GetTeamNumber() == TEAM_PINK )
	{
		if ( m_nSkin != toSkinId(PLAYER_SKIN_ROSE) )
		{
			szModelName = g_ppszRandomCombineModels[0];
			m_nSkin = 0;
		}

		m_iModelType = TEAM_PINK;
	}
	else if ( GetTeamNumber() == TEAM_GREEN )
	{
		if ( m_nSkin !=  toSkinId(PLAYER_SKIN_VERT))
		{
			szModelName = g_ppszRandomCitizenModels[0];
			m_nSkin = toSkinId(PLAYER_SKIN_VERT);
		}

		m_iModelType = TEAM_GREEN;
	}
	
	SetModel( szModelName );
	SetupPlayerSoundsByModel( szModelName );

	m_flNextModelChangeTime = gpGlobals->curtime + MODEL_CHANGE_INTERVAL;
}
Пример #2
0
void CGameFortsInfoZone::ResetAllInfos(bool bPlayLostDataSound)
{
	for(int i = 0; i < FORTS_MAX_INFOS; i++)
	{
		if(HL2MPRules()->m_apFortsInfosPink[i] != NULL)
		{
			HL2MPRules()->m_apFortsInfosPink[i]->m_nSkin = toSkinId(PLAYER_SKIN_ROSE);
			HL2MPRules()->m_apFortsInfosPink[i]->EmitSound("Gameplay.Forts.LostData");
			HL2MPRules()->m_apFortsInfosPink[i] = NULL;
		}
		if(HL2MPRules()->m_apFortsInfosGreen[i] != NULL)
		{
			HL2MPRules()->m_apFortsInfosGreen[i]->m_nSkin = toSkinId(PLAYER_SKIN_VERT);
			HL2MPRules()->m_apFortsInfosGreen[i]->EmitSound("Gameplay.Forts.LostData");
			HL2MPRules()->m_apFortsInfosGreen[i] = NULL;
		}
	}
}