void asw_report_difficulty_f() { Msg("Skill level = %d\n", ASWGameRules()->GetSkillLevel()); Msg("Mission Difficulty level = %d\n", ASWGameRules()->GetMissionDifficulty()); CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient()); CPASAttenuationFilter filter( pPlayer ); CSoundParameters params; if ( CBaseEntity::GetParametersForSound( "crash.selection", params, NULL ) ) { EmitSound_t ep( params ); ep.m_flVolume = 1.0f; ep.m_nChannel = CHAN_AUTO; ep.m_pOrigin = &pPlayer->GetAbsOrigin(); ep.m_nPitch = params.pitch * random->RandomFloat(0.5, 3.0); CBaseEntity::EmitSound( filter, 0, ep ); } }
void CC_asw_teleport( const CCommand &args ) { CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient()); if ( !pPlayer ) return; Vector vTargetPos = pPlayer->GetAbsOrigin(); // fires a command from the console if ( args.ArgC() < 2 ) { trace_t tr; Vector vPlayerForward; pPlayer->EyeVectors( &vPlayerForward, NULL, NULL ); UTIL_TraceLine( pPlayer->GetAbsOrigin(), pPlayer->GetAbsOrigin() + vPlayerForward * 10000.0f, MASK_SOLID, pPlayer, COLLISION_GROUP_NONE, &tr ); if ( tr.DidHit() ) { vTargetPos = tr.endpos; } } else { // find the named entity CBaseEntity *target = gEntList.FindEntityByName( NULL, args[1] ); if ( !target ) { int i = atoi( args[1] ); if ( i != 0 ) { target = CBaseEntity::Instance( i ); if ( !target ) { Msg( "Couldn't find entity!\n" ); return; } } else { Msg( "Couldn't find entity!\n" ); return; } } vTargetPos = target->GetAbsOrigin(); } CASW_Marine *pMarine = pPlayer->GetMarine(); if ( !pMarine ) { for ( int i = 0; i < ASWGameResource()->GetMaxMarineResources(); ++i ) { CASW_Marine_Resource *pMR = ASWGameResource()->GetMarineResource( i ); if ( !pMR ) continue; if ( pMR->GetMarineEntity() && pMR->GetMarineEntity()->GetCommander() == pPlayer ) { pMarine = pMR->GetMarineEntity(); break; } } } if ( pMarine ) { // Teleport the dude under our control Vector vecPos = vTargetPos;//pNearest->GetOrigin(); pMarine->Teleport( &vecPos, NULL, NULL ); } }