• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ IsSpawned函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Create

bool CVehicleEntity::Create()
{
	// Is the vehicle already spawned?
	if(IsSpawned())
		return false;

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

	DWORD dwModelHash = m_pModelInfo->GetHash();

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

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

	// Disable damage
	m_pVehicle->SetCarCanBeDamaged(false);
	m_pVehicle->SetCanBeVisiblyDamaged(false);

	// Reset Indicators
	SetIndicatorState(false,false,true,true);

	// Mark as spawned
	m_bSpawned = true;

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


示例17: SetTargetRotation

void CVehicleEntity::SetTargetRotation(const CVector3& vecRotation, unsigned long ulDelay)
{
    // Are we spawned?
    if(IsSpawned())
	{
        // Update our target rotation
        UpdateTargetRotation();

        // Get the current time
        unsigned long ulTime = SharedUtility::GetTime();

        // Get our local rotation
        CVector3 vecLocalRotation;
        GetRotation(vecLocalRotation);

        // Set the target rotation
        m_interp.rot.vecTarget = vecRotation;

        // Get the error
        m_interp.rot.vecError = Math::GetOffsetDegrees(vecLocalRotation, vecRotation);

        // Get the interpolation interval
        m_interp.rot.ulStartTime = ulTime;
        m_interp.rot.ulFinishTime = (ulTime + ulDelay);

        // Initialize the interpolation
        m_interp.rot.fLastAlpha = 0.0f;
    }

    // Set our rotation straight
    m_vecRotation = vecRotation;
}
开发者ID:KomiHe,项目名称:IVMultiplayer,代码行数:32,代码来源:CVehicleEntity.cpp


示例18: SetTargetPosition

void CVehicleEntity::SetTargetPosition(const CVector3& vecPosition, unsigned long ulDelay)
{
    // Are we spawned?
    if(IsSpawned())
    {
        // Update our target position
        UpdateTargetPosition();

        // Get the current time
        unsigned long ulTime = SharedUtility::GetTime();

        // Get our local position
        CVector3 vecLocalPosition;
        GetPosition(vecLocalPosition);

        // Set the target position
        m_interp.pos.vecTarget = vecPosition;

        // Calculate the relative error
        m_interp.pos.vecError = (vecPosition - vecLocalPosition);

        // Apply the error over 400ms (i.e. 1/4 per 100ms)
        m_interp.pos.vecError *= Math::Lerp<const float>(0.25f, Math::UnlerpClamped(100, ulDelay, 400), 1.0f);

        // Get the interpolation interval
        m_interp.pos.ulStartTime = ulTime;
        m_interp.pos.ulFinishTime = (ulTime + ulDelay);

        // Initialize the interpolation
        m_interp.pos.fLastAlpha = 0.0f;
    }

    // Set our position straight
    m_vecPosition = vecPosition;
}
开发者ID:KomiHe,项目名称:IVMultiplayer,代码行数:35,代码来源:CVehicleEntity.cpp


示例19: switch

void CVehicleEntity::SetDoorLockState(DWORD dwDoorLockState)
{
	// Get the actual lock state
	DWORD dwState = 0;

	switch(dwDoorLockState)
	{
		case 0:
			dwState = 0;
			break;
		case 1:
			dwState = 3;
			break;
		case 2:
			dwState = 7;
			break;
		default:
		return;
	}

	m_dwDoorLockState = dwState;

	// Are we spawned?
	if(IsSpawned())
		CIVScript::LockCarDoor(GetScriptingHandle(), m_dwDoorLockState);
}
开发者ID:KomiHe,项目名称:IVMultiplayer,代码行数:26,代码来源:CVehicleEntity.cpp


示例20: SetRotation

void CObject::SetRotation(const CVector3& vecRotation)
{
	// Are we spawned?
	if(IsSpawned())
		Scripting::SetObjectRotation(m_uiObjectHandle, vecRotation.fX, vecRotation.fY, vecRotation.fZ);

	m_vecRotation = vecRotation;
}
开发者ID:JamesConway69,项目名称:ivmultiplayer,代码行数:8,代码来源:CObject.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ IsStopped函数代码示例发布时间:2022-05-30
下一篇:
C++ IsSoulBound函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap