本文整理汇总了C++中CVehicle::DoesVehicleHaveSirens方法的典型用法代码示例。如果您正苦于以下问题:C++ CVehicle::DoesVehicleHaveSirens方法的具体用法?C++ CVehicle::DoesVehicleHaveSirens怎么用?C++ CVehicle::DoesVehicleHaveSirens使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVehicle
的用法示例。
在下文中一共展示了CVehicle::DoesVehicleHaveSirens方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessVehicleSirenPosition
bool ProcessVehicleSirenPosition ( )
{
// Valid interface
if ( pVehicleWithTheSiren )
{
// Grab our vehicle from the interface
CVehicle * pVehicle = pGameInterface->GetPools ()->GetVehicle ( (DWORD *)pVehicleWithTheSiren );
// Valid - Wait this seems familiar
if ( pVehicle )
{
// Disable our original siren based vehicles from this hook
if ( DoesVehicleHaveSiren ( ) && pVehicle->DoesVehicleHaveSirens ( ) == false )
{
ucSirenCount = 0;
// Set our time based alpha to 10% of the current time float
fTime = *((float*)0xB7C4E4) * 0.1f;
// Get our minimum alpha
DWORD dwMinimumAlpha = pVehicle->GetVehicleSirenMinimumAlpha ( ucSirenCount );
// Times the min alpha (255) by a multiplier to get it 0.0f-1.0f this multiplier was gained by doing 1.0 / 255.
float fMinimumAlpha = dwMinimumAlpha * 0.003921568627451f;
// if our time is less than or equal to the minimum alpha
if ( fTime <= dwMinimumAlpha )
{
// Set it to the minimum
fTime = fMinimumAlpha;
}
// Set our red based on 255 and our blue based on 255 and green based on 0.. default SA values of course.
/*if ( dwRed > 0 )
dwRed = (DWORD)( dwRed * fTime );
if ( dwBlue > 0 )
dwBlue = (DWORD)( dwBlue * fTime );
if ( dwGreen > 0 )
dwGreen = (DWORD)( dwGreen * fTime );*/
bPointLights = false;
// return false so our hook knows we decided not to edit anything
return false;
}
// Does the vehicle have sirens and is the siren count greater than 0
if ( pVehicle->DoesVehicleHaveSirens ( ) && pVehicle->GetVehicleSirenCount ( ) > 0 )
{
// Get our siren count
unsigned char ucVehicleSirenCount = pVehicle->GetVehicleSirenCount ( );
// Get our current Siren ID
ucSirenCount = pVehicle->GetVehicleCurrentSirenID ( );
// Get our randomiser
ucRandomiser = pVehicle->GetSirenRandomiser ( );
if ( pVehicle->IsSirenRandomiserEnabled ( ) )
{
// Make sure we aren't beyond our limit
if ( ucSirenCount > ucVehicleSirenCount )
{
// if we have more than 1 sirens
if ( ucVehicleSirenCount > 0 )
// Set our Randomiser
ucRandomiser = rand () % ucVehicleSirenCount;
else
// Set our Randomiser
ucRandomiser = 0;
if ( bPointLights == false )
{
// Update our stored Randomiser
pVehicle->SetSirenRandomiser ( ucRandomiser );
}
}
else
{
// Set our Randomiser
ucRandomiser = rand () % ucVehicleSirenCount;
if ( bPointLights == false )
{
// Update our stored Randomiser
pVehicle->SetSirenRandomiser ( ucRandomiser );
}
}
}
else
{
ucRandomiser++;
if ( ucRandomiser >= ucVehicleSirenCount )
{
ucRandomiser = 0;
}
if ( bPointLights == false )
{
// Update our stored Randomiser
pVehicle->SetSirenRandomiser ( ucRandomiser );
}
}
ucSirenCount = ucRandomiser;
if ( bPointLights == false )
{
// Gete our siren position for this siren count
pVehicle->GetVehicleSirenPosition ( ucSirenCount, *vecRelativeSirenPosition );
}
if ( bPointLights == false )
//.........这里部分代码省略.........