当前位置: 首页>>代码示例>>C++>>正文


C++ IsSpawned函数代码示例

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


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

示例1: Destroy

bool CVehicleEntity::Destroy()
{
	// Is the vehicle not spawned?
	if(!IsSpawned())
		return false;

	// Remove the vehicle from the world
	m_pVehicle->RemoveFromWorld();

	// Remove the vehicle reference
	m_pModelInfo->RemoveReference();

	// Release the entity
	m_pVehicle->GetEntity()->Remove();

	// Mark vehicle as no longer needed
	IVVehicle * pVehicle = m_pVehicle->GetVehicle();
	*(BYTE *)(pVehicle + 3949) |= 8u;
	*(BYTE *)(pVehicle + 4360) = 1; // Disable function call(some loops through arrays..)

	// Destroy the vehicle
	CIVScript::DeleteCar(&m_uiVehicleHandle);

	// Delete the vehicle instance
	SAFE_DELETE(m_pVehicle);

	// Mark as not spawned
	m_bSpawned = false;

	return true;
}
开发者ID:andrefsantos,项目名称:IVMultiplayer-1,代码行数:31,代码来源:CVehicleEntity.cpp

示例2: Create

bool CVehicleEntity::Create()
{
	if (m_pModelInfo == NULL)
		return false;

	// Is the vehicle already spawned?
	if (IsSpawned())
		return false;

	// Load the model
	m_pModelInfo->AddReference(true);

	DWORD dwModelHash = m_pModelInfo->GetHash();

	CIVScript::CreateCar(dwModelHash, 0.0f, 0.0f, 0.0f, &m_uiVehicleHandle, true);

    // Create the vehicle instance
	m_pVehicle = new CIVVehicle(g_pCore->GetGame()->GetPools()->GetVehiclePool()->AtHandle(m_uiVehicleHandle));

	// Mark as spawned
	m_bSpawned = true;

	// Reset the vehicle
	Reset();

	CLogFile::Printf("Created vehicle! (Id: %d, Handle: %d)", m_vehicleId, m_uiVehicleHandle);
	return true;
}
开发者ID:andrefsantos,项目名称:IVMultiplayer-1,代码行数:28,代码来源:CVehicleEntity.cpp

示例3: DEBUG_TRACE

void CNetworkPlayer::HandlePlayerDeath( void )
{
	DEBUG_TRACE("CNetworkPlayer::HandlePlayerDeath");

	// Is the localplayer not spawned?
	if( !pCore->GetPlayerManager()->GetLocalPlayer()->IsSpawned() )
		return;

	// Is the player invalid?
	if( !IsSpawned() || !m_pPlayerPed )
		return;

	// Reset invulnerability
	m_pPlayerPed->SetInvulnerable( false );

	// Set the player health
	m_pPlayerPed->SetHealth( 0.0f );

	// Mark as dead
	SetDead( true );

	// Mark as not spawned
	SetSpawned( false );

	// Are we in a vehicle as driver?
	if( IsInVehicle() )
	{
		// Reset the vehicle interpolation
		m_pVehicle->ResetInterpolation();
	}

	// Set the playerstate
	m_playerState = ePlayerState::PLAYERSTATE_DEAD;
}
开发者ID:DarkKlo,项目名称:maf2mp,代码行数:34,代码来源:CNetworkPlayer.cpp

示例4: GetMobInfo

	// get mob info if you fish one up
	void GetMobInfo(CCharEntity* PChar)
	{
		const int8* Query = "SELECT mobid, type,zone \
							FROM fishing_mobs \
							WHERE zone = %u \
							ORDER BY zone ASC";

		int32 ret = Sql_Query(SqlHandle, Query, PChar->getZone());
		int RC = 0;
		// this will pick a random  number from range 1 to max record count
		int RID = rand() % Sql_NumRows(SqlHandle) + 1;

		if (ret != SQL_ERROR && Sql_NumRows(SqlHandle) != 0)
		{
			while (Sql_NextRow(SqlHandle) == SQL_SUCCESS)
			{
				RC = RC + 1;
				if (RC == RID && Sql_GetIntData(SqlHandle, 0) != 0)
				{
					if (IsSpawned(Sql_GetIntData(SqlHandle, 0)) == false)
					{
						mobid[0] = Sql_GetIntData(SqlHandle, 0);
						catchtype[0] = Sql_GetIntData(SqlHandle, 1); // Type
						break;
					}
				}
			}
		}
	}
开发者ID:EDGECOM666,项目名称:Fishing_RC1,代码行数:30,代码来源:fishingutils.cpp

示例5: GetTurnSpeed

void CClientVehicle::GetTurnSpeed(CVector3& vecTurnSpeed)
{
	if(IsSpawned())
		m_pVehicle->GetTurnSpeed(&vecTurnSpeed);
	else
		vecTurnSpeed = m_vecTurnSpeed;
}
开发者ID:Azon099,项目名称:networked-iv,代码行数:7,代码来源:CClientVehicle.cpp

示例6: GetPosition

void CVehicleEntity::GetPosition(CVector3& vecPosition)
{
	if(IsSpawned())
		m_pVehicle->GetPosition(&vecPosition);
	else
		vecPosition = m_vecPosition;
}
开发者ID:KomiHe,项目名称:IVMultiplayer,代码行数:7,代码来源:CVehicleEntity.cpp

示例7: SetRotation

void CClientVehicle::SetRotation(const CVector3& vecRotation)
{
	if(IsSpawned())
	{
		// Remove the vehicle from the world
		m_pVehicle->RemoveFromWorld();

		// Get the vehicle matrix
		Matrix matMatrix;
		m_pVehicle->GetMatrix(&matMatrix);

		// Convert the rotation to radians and apply it to the vehicle matrix
		CVector3 vecNewRotation = vecRotation;
		ConvertDegreesToRadians(vecNewRotation);
		g_pClient->GetGame()->ConvertEulerAnglesToRotationMatrix(vecNewRotation, matMatrix);

		// Set the new vehicle matrix
		m_pVehicle->SetMatrix(&matMatrix);

		// Re-add the vehicle to the world
		m_pVehicle->AddToWorld();
	}

	m_vecRotation = vecRotation;
}
开发者ID:Azon099,项目名称:networked-iv,代码行数:25,代码来源:CClientVehicle.cpp

示例8: SetTurnSpeed

void CClientVehicle::SetTurnSpeed(const CVector3& vecTurnSpeed)
{
	if(IsSpawned())
		m_pVehicle->SetTurnSpeed((CVector3 *)&vecTurnSpeed);

	m_vecTurnSpeed = vecTurnSpeed;
}
开发者ID:Azon099,项目名称:networked-iv,代码行数:7,代码来源:CClientVehicle.cpp

示例9: GetScriptingHandle

unsigned int CClientVehicle::GetScriptingHandle()
{
	if(IsSpawned())
		return CPools::GetVehiclePool()->HandleOf(m_pVehicle->GetVehicle());

	return 0;
}
开发者ID:Azon099,项目名称:networked-iv,代码行数:7,代码来源:CClientVehicle.cpp

示例10: Pulse

void CLocalPlayer::Pulse()
{
	CPlayerEntity::Pulse();

	if(IsSpawned()) {
		DoDeathCheck();
		
		if(!m_bParachuteCheck) {

			// Create "simulated" parachute
			CIVScript::GiveWeaponToChar(GetScriptingHandle(), 41, 1, false);
			DWORD dwParachute = 0x4C19FE43; //0x402B7648;
			CVector3 vecCurrPos;
			GetPosition(vecCurrPos);

			CIVScript::CreateObject(dwParachute, vecCurrPos.fX, vecCurrPos.fY, -25.0 , &m_pObj, 1);
			CIVScript::SetObjectDynamic(m_pObj, 1);
			CIVScript::SetObjectCollision(m_pObj, 1);
			CIVScript::SetObjectVisible(m_pObj, 0);
			CIVScript::SetActivateObjectPhysicsAsSoonAsItIsUnfrozen(m_pObj, 1);
			CIVScript::AttachObjectToPed(m_pObj, GetScriptingHandle(), 1202, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 0.00000000, 1);

			m_bParachuteCheck = true;
		}

		if(!m_bParachuteIntitialised)
		{
			//g_pCore->GetGame()->OnClientPastGameJoin();
			m_bParachuteIntitialised = true;
		}
	}
	m_bSpawnMarked = true;
}
开发者ID:DarkSlim,项目名称:IVMultiplayer-1,代码行数:33,代码来源:CLocalPlayer.cpp

示例11: GetVehicleGPSState

bool CVehicleEntity::GetVehicleGPSState()
{
	if (IsSpawned())
		return m_pVehicle->GetGPSState();

	return false;
}
开发者ID:Disinterpreter,项目名称:IV-Network,代码行数:7,代码来源:CVehicleEntity.cpp

示例12: GetMaxPassengers

BYTE CClientVehicle::GetMaxPassengers()
{
	if(IsSpawned())
		return m_pVehicle->GetMaxPasssengers();

	return 0;
}
开发者ID:Azon099,项目名称:networked-iv,代码行数:7,代码来源:CClientVehicle.cpp

示例13: GetScriptingHandle

unsigned int CVehicleEntity::GetScriptingHandle()
{
	if(IsSpawned())
		return g_pCore->GetGame()->GetPools()->GetVehiclePool()->HandleOf(m_pVehicle->GetVehicle());

	return 0;
}
开发者ID:KomiHe,项目名称:IVMultiplayer,代码行数:7,代码来源:CVehicleEntity.cpp

示例14: SoundHorn

void CVehicleEntity::SoundHorn(int iDuration)
{
    if(IsSpawned())
		m_pVehicle->SoundHorn(iDuration);

    m_ulHornDurationEnd = (SharedUtility::GetTime() + iDuration);
}
开发者ID:KomiHe,项目名称:IVMultiplayer,代码行数:7,代码来源:CVehicleEntity.cpp

示例15: GetLightsState

bool CVehicleEntity::GetLightsState()
{
	if (IsSpawned())
		return (m_pVehicle->GetLightsState() == 2);

	return m_bLights;
}
开发者ID:Disinterpreter,项目名称:IV-Network,代码行数:7,代码来源:CVehicleEntity.cpp


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