本文整理汇总了C++中CBaseMultiplayerPlayer::GetUserID方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseMultiplayerPlayer::GetUserID方法的具体用法?C++ CBaseMultiplayerPlayer::GetUserID怎么用?C++ CBaseMultiplayerPlayer::GetUserID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseMultiplayerPlayer
的用法示例。
在下文中一共展示了CBaseMultiplayerPlayer::GetUserID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ClientCommand
bool CMultiplayRules::ClientCommand( CBaseEntity *pEdict, const CCommand &args )
{
CBasePlayer *pPlayer = ToBasePlayer( pEdict );
const char *pcmd = args[0];
if ( FStrEq( pcmd, "voicemenu" ) )
{
if ( args.ArgC() < 3 )
return true;
CBaseMultiplayerPlayer *pMultiPlayerPlayer = dynamic_cast< CBaseMultiplayerPlayer * >( pPlayer );
if ( pMultiPlayerPlayer )
{
int iMenu = atoi( args[1] );
int iItem = atoi( args[2] );
VoiceCommand( pMultiPlayerPlayer, iMenu, iItem );
}
return true;
}
else if ( FStrEq( pcmd, "achievement_earned" ) )
{
CBaseMultiplayerPlayer *pPlayer = static_cast<CBaseMultiplayerPlayer*>( pEdict );
if ( pPlayer && pPlayer->ShouldAnnounceAchievement() )
{
// let's check this came from the client .dll and not the console
unsigned short mask = UTIL_GetAchievementEventMask();
int iPlayerID = pPlayer->GetUserID();
int iAchievement = atoi( args[1] ) ^ mask;
int code = ( iPlayerID ^ iAchievement ) ^ mask;
if ( code == atoi( args[2] ) )
{
IGameEvent * event = gameeventmanager->CreateEvent( "achievement_earned" );
if ( event )
{
event->SetInt( "player", pEdict->entindex() );
event->SetInt( "achievement", iAchievement );
gameeventmanager->FireEvent( event );
}
pPlayer->OnAchievementEarned( iAchievement );
}
}
return true;
}
return BaseClass::ClientCommand( pEdict, args );
}