本文整理汇总了C++中CBasePlayer::CItemMaterialize方法的典型用法代码示例。如果您正苦于以下问题:C++ CBasePlayer::CItemMaterialize方法的具体用法?C++ CBasePlayer::CItemMaterialize怎么用?C++ CBasePlayer::CItemMaterialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBasePlayer
的用法示例。
在下文中一共展示了CBasePlayer::CItemMaterialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SpawnOnClientSpawn
/**
* The player is spawning.
*
* @param clientIndex The client index.
**/
void SpawnOnClientSpawn(int clientIndex)
{
// Get real player index from event key
CBasePlayer* cBasePlayer = view_as<CBasePlayer>(clientIndex);
// Update weapons and model indexes
if(cBasePlayer->m_bSurvivor || cBasePlayer->m_bZombie || gRoundNum <= 1)
{
// Remove all weapons
WeaponsRemoveAll(cBasePlayer);
// Give default weapon
cBasePlayer->CItemMaterialize(WEAPONS_SPAWN_WEAPON);
}
// If gamemode didn't started
if(bNewRound)
{
// Reset respawn count
cBasePlayer->m_nRespawnTimes = 0;
// Reset limit of extra items
ItemsRemoveLimit(view_as<int>(cBasePlayer));
}
// Reset all variables
cBasePlayer->m_bZombie = false;
cBasePlayer->m_bSurvivor = false;
cBasePlayer->m_bNemesis = false;
cBasePlayer->m_bSkill = false;
cBasePlayer->m_bNightVisionOn = 0;
cBasePlayer->m_nLastBoughtAmount = 0;
cBasePlayer->m_nSkillCountDown = 0;
cBasePlayer->m_iLevel = 1;
cBasePlayer->m_iMoveType = MOVETYPE_WALK;
cBasePlayer->m_nModelIndex = WeaponGetViewModelIndex(view_as<int>(cBasePlayer));
cBasePlayer->m_iHealth = GetConVarInt(gCvarList[CVAR_HUMAN_HEALTH]);
cBasePlayer->m_iArmorValue = GetConVarInt(gCvarList[CVAR_HUMAN_ARMOR]);
cBasePlayer->m_flLaggedMovementValue = GetConVarFloat(gCvarList[CVAR_HUMAN_SPEED]);
cBasePlayer->m_flGravity = GetConVarFloat(gCvarList[CVAR_HUMAN_GRAVITY]);
cBasePlayer->m_iFOV(90);
cBasePlayer->m_bSetGlow(false);
cBasePlayer->m_bFlashLightOn(false);
cBasePlayer->m_iRender(255, 255, 255);
// Store spawn origin
cBasePlayer->m_flGetOrigin(flSpawnOrigin[view_as<int>(cBasePlayer)]);
// Respawn as zombie?
if(cBasePlayer->m_bRespawn == ZP_TEAM_ZOMBIE)
{
// Is mode started ?
if (bModeStarted)
{
// Make a zombie
InfectHumanToZombie(view_as<int>(cBasePlayer), false, true);
return;
}
}
// Update human model
ModelsOnClientSpawn(view_as<int>(cBasePlayer));
// Update level overlay
ToolsSwitchLevel(cBasePlayer, cBasePlayer->m_iLevel);
}