本文整理汇总了C++中CGameContext::ModifyWeapons方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameContext::ModifyWeapons方法的具体用法?C++ CGameContext::ModifyWeapons怎么用?C++ CGameContext::ModifyWeapons使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameContext
的用法示例。
在下文中一共展示了CGameContext::ModifyWeapons方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConRocket
void CGameContext::ConRocket(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
if (!CheckClientID(pResult->m_ClientID))
return;
int Victim = pResult->GetVictim();
CPlayer *pPlayer = pSelf->m_apPlayers[Victim];
if(!pPlayer)
return;
pSelf->ModifyWeapons(pResult, pUserData, WEAPON_GRENADE, false);
char aBuf[128];
if (!pPlayer->m_IsRocket)
{
pPlayer->m_IsRocket = true;
str_format(aBuf, sizeof(aBuf), "You got Rocket by %s.", pSelf->Server()->ClientName(pResult->m_ClientID));
pSelf->SendChatTarget(Victim, aBuf);
}
else
{
pPlayer->m_IsRocket = false;
str_format(aBuf, sizeof(aBuf), "%s removed your Rocket.", pSelf->Server()->ClientName(pResult->m_ClientID));
pSelf->SendChatTarget(Victim, aBuf);
}
}
示例2: ConRemoveWeapon
void CGameContext::ConRemoveWeapon(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *) pUserData;
pSelf->ModifyWeapons(pResult, pUserData, pResult->GetInteger(0), true);
}
示例3: ConUnWeapons
void CGameContext::ConUnWeapons(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *) pUserData;
pSelf->ModifyWeapons(pResult, pUserData, -1, true);
}
示例4: ConUnRifle
void CGameContext::ConUnRifle(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *) pUserData;
pSelf->ModifyWeapons(pResult, pUserData, WEAPON_RIFLE, true);
}
示例5: ConUnGrenade
void CGameContext::ConUnGrenade(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *) pUserData;
pSelf->ModifyWeapons(pResult, pUserData, WEAPON_GRENADE, true);
}
示例6: ConUnShotgun
void CGameContext::ConUnShotgun(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *) pUserData;
pSelf->ModifyWeapons(pResult, pUserData, WEAPON_SHOTGUN, true);
}
示例7: ConNinja
void CGameContext::ConNinja(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *) pUserData;
pSelf->ModifyWeapons(pResult, pUserData, WEAPON_NINJA, false);
}