本文整理汇总了C++中playerhandler::const_iterator::aimingAt方法的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator::aimingAt方法的具体用法?C++ const_iterator::aimingAt怎么用?C++ const_iterator::aimingAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类playerhandler::const_iterator
的用法示例。
在下文中一共展示了const_iterator::aimingAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RT_PlayerRunCommandCallback
PlayerRunCommandRet ShotTester::RT_PlayerRunCommandCallback ( PlayerHandler::const_iterator ph, void* pCmd, void* lastcmd )
{
PlayerRunCommandRet drop_cmd = PlayerRunCommandRet::CONTINUE;
ShotStatsT * const playerData ( GetPlayerDataStructByIndex ( ph.GetIndex () ) );
float const curtime ( Plat_FloatTime () );
bool cur_in_attack;
bool past_in_attack;
if( SourceSdk::InterfacesProxy::m_game == SourceSdk::CounterStrikeGlobalOffensive )
{
cur_in_attack = ( static_cast< SourceSdk::CUserCmd_csgo* >( pCmd )->buttons & IN_ATTACK ) != 0;
past_in_attack = ( static_cast< SourceSdk::CUserCmd_csgo* >( lastcmd )->buttons & IN_ATTACK ) != 0;
}
else
{
cur_in_attack = ( static_cast< SourceSdk::CUserCmd* >( pCmd )->buttons & IN_ATTACK ) != 0;
past_in_attack = ( static_cast< SourceSdk::CUserCmd* >( lastcmd )->buttons & IN_ATTACK ) != 0;
}
if( cur_in_attack && !past_in_attack )
{
//SystemVerbose1(Helpers::format("Player %s : IN_ATTACK button down.", ph->GetName()));
playerData->down_time = curtime;
}
else if( past_in_attack && !cur_in_attack )
{
playerData->up_time = curtime;
TriggerStat ( &( playerData->clicks ), playerData->up_time, playerData->down_time, playerData->clicks.n );
//SystemVerbose1(Helpers::format("Player %s : IN_ATTACK button up.", ph->GetName()));
if( playerData->up_time - playerData->down_time <= SHORT_TIME )
{
if( curtime - playerData->last_detection > 1.0 )
{
if( playerData->row == 1 )
{
if( playerData->on_target.ratio > 25.0 && playerData->clicks.n > 50 )
{
Detection_TriggerBot pDetection;
pDetection.PrepareDetectionData ( playerData );
pDetection.PrepareDetectionLog ( *ph, this );
pDetection.Log ();
ph->Ban ();
}
}
playerData->row = 0;
}
if( playerData->row > 10 )
{
if( playerData->short_clicks.ratio > 40.0 && playerData->clicks.n > 50 )
{
Detection_AutoPistol pDetection;
pDetection.PrepareDetectionData ( playerData );
pDetection.PrepareDetectionLog ( *ph, this );
pDetection.Log ();
ph->Ban ();
}
}
playerData->last_detection = curtime;
++( playerData->row );
TriggerStat ( &( playerData->short_clicks ), playerData->up_time, playerData->down_time, playerData->clicks.n );
if( ph->GetWpnShotType () == HAND ) TriggerStat ( &( playerData->with_hand ), playerData->up_time, playerData->down_time, playerData->clicks.n );
else if( ph->GetWpnShotType () == PISTOL ) TriggerStat ( &( playerData->with_pistol ), playerData->up_time, playerData->down_time, playerData->clicks.n );
else TriggerStat ( &( playerData->with_auto ), playerData->up_time, playerData->down_time, playerData->clicks.n );
if( ph->aimingAt () > 0 ) TriggerStat ( &( playerData->on_target ), playerData->up_time, playerData->down_time, playerData->clicks.n );
drop_cmd = PlayerRunCommandRet::INERT;
if( this->m_verbose )
{
printf ( "%f - clicks ", curtime );
OutputStat ( &( playerData->clicks ) );
printf ( ", short_clicks " );
OutputStat ( &( playerData->short_clicks ) );
printf ( ", with_hand " );
OutputStat ( &( playerData->with_hand ) );
printf ( ", with_pistol " );
OutputStat ( &( playerData->with_pistol ) );
printf ( ", with_auto " );
OutputStat ( &( playerData->with_auto ) );
printf ( ", on_target " );
OutputStat ( &( playerData->on_target ) );
printf ( ", row %u\n", playerData->row );
}
}
}
return drop_cmd;
}