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


C++ CGameContext::ModifyWeapons方法代码示例

本文整理汇总了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);
	}
}
开发者ID:SoMeRelaX,项目名称:ddnet,代码行数:28,代码来源:ddracecommands.cpp

示例2: ConRemoveWeapon

void CGameContext::ConRemoveWeapon(IConsole::IResult *pResult, void *pUserData)
{
	CGameContext *pSelf = (CGameContext *) pUserData;
	pSelf->ModifyWeapons(pResult, pUserData, pResult->GetInteger(0), true);
}
开发者ID:BigCrazyChris,项目名称:XXLDDRace,代码行数:5,代码来源:ddracecommands.cpp

示例3: ConUnWeapons

void CGameContext::ConUnWeapons(IConsole::IResult *pResult, void *pUserData)
{
	CGameContext *pSelf = (CGameContext *) pUserData;
	pSelf->ModifyWeapons(pResult, pUserData, -1, true);
}
开发者ID:BigCrazyChris,项目名称:XXLDDRace,代码行数:5,代码来源:ddracecommands.cpp

示例4: ConUnRifle

void CGameContext::ConUnRifle(IConsole::IResult *pResult, void *pUserData)
{
	CGameContext *pSelf = (CGameContext *) pUserData;
	pSelf->ModifyWeapons(pResult, pUserData, WEAPON_RIFLE, true);
}
开发者ID:BigCrazyChris,项目名称:XXLDDRace,代码行数:5,代码来源:ddracecommands.cpp

示例5: ConUnGrenade

void CGameContext::ConUnGrenade(IConsole::IResult *pResult, void *pUserData)
{
	CGameContext *pSelf = (CGameContext *) pUserData;
	pSelf->ModifyWeapons(pResult, pUserData, WEAPON_GRENADE, true);
}
开发者ID:BigCrazyChris,项目名称:XXLDDRace,代码行数:5,代码来源:ddracecommands.cpp

示例6: ConUnShotgun

void CGameContext::ConUnShotgun(IConsole::IResult *pResult, void *pUserData)
{
	CGameContext *pSelf = (CGameContext *) pUserData;
	pSelf->ModifyWeapons(pResult, pUserData, WEAPON_SHOTGUN, true);
}
开发者ID:BigCrazyChris,项目名称:XXLDDRace,代码行数:5,代码来源:ddracecommands.cpp

示例7: ConNinja

void CGameContext::ConNinja(IConsole::IResult *pResult, void *pUserData)
{
	CGameContext *pSelf = (CGameContext *) pUserData;
	pSelf->ModifyWeapons(pResult, pUserData, WEAPON_NINJA, false);
}
开发者ID:BigCrazyChris,项目名称:XXLDDRace,代码行数:5,代码来源:ddracecommands.cpp


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