void C_Camera::Init() { ListenForGameEvent( "game_newmap" ); ListenForGameEvent( "hltv_message" ); Reset(); }
virtual void ListenForEvents() { ListenForGameEvent( "player_hurt" ); ListenForGameEvent( "player_death" ); ListenForGameEvent( "round_start" ); VarInit(); }
virtual void ListenForEvents() { m_bDD44Only = true; ListenForGameEvent( "player_hurt" ); ListenForGameEvent( "round_start" ); CGEAchBaseAwardType::ListenForEvents(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CTFWinPanel::Init() { // listen for events ListenForGameEvent( "teamplay_win_panel" ); ListenForGameEvent( "teamplay_round_start" ); ListenForGameEvent( "teamplay_game_over" ); ListenForGameEvent( "tf_game_over" ); m_bShouldBeVisible = false; CHudElement::Init(); }
bool Init() { BaseClass::Init(); ListenForGameEvent( "player_death" ); ListenForGameEvent( "player_hurt" ); #if defined ( SDK_USE_PLAYERCLASSES ) ListenForGameEvent( "player_changeclass" ); #endif // SDK_USE_PLAYERCLASSES return true; }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CTFFreezePanel::Init() { // listen for events ListenForGameEvent( "show_freezepanel" ); ListenForGameEvent( "hide_freezepanel" ); ListenForGameEvent( "freezecam_started" ); ListenForGameEvent( "player_death" ); ListenForGameEvent( "teamplay_win_panel" ); Hide(); CHudElement::Init(); }
void CTFHLTVDirector::SetHLTVServer( IHLTVServer *hltv ) { BaseClass::SetHLTVServer( hltv ); if ( m_pHLTVServer ) { // mod specific events the director uses to find interesting shots ListenForGameEvent( "teamplay_point_captured" ); ListenForGameEvent( "teamplay_capture_blocked" ); ListenForGameEvent( "teamplay_point_startcapture" ); ListenForGameEvent( "teamplay_flag_event" ); ListenForGameEvent( "ctf_flag_captured" ); } }
bool CASWJukeboxPlaylist::Init() { m_pCombatMusic = NULL; m_iCurrentTrack = -1; // Load the saved playlist LoadPlaylistKV(); ListenForGameEvent( "jukebox_play_random" ); ListenForGameEvent( "jukebox_stop" ); return true; }
void CGenericClassBasedReplay::OnBeginRecording() { BaseClass::OnBeginRecording(); Assert( gameeventmanager ); ListenForGameEvent( "player_death" ); }
void CBaseHudChat::Init( void ) { if ( IsXbox() ) return; ListenForGameEvent( "hltv_chat" ); }
//========================================================= // Inicializa al Instructor //========================================================= bool C_GameInstructor::Init() { // if ( &GetGameInstructor() == this ) // return true; // Instructor desactivado, no inicializar. if ( !gameinstructor_enable.GetBool() || sv_gameinstructor_disable.GetBool() ) return true; if ( gameinstructor_verbose.GetInt() > 0 ) { ConColorMsg( CBaseLesson::m_rgbaVerboseHeader, "[INSTRUCTOR]: " ); ConColorMsg( CBaseLesson::m_rgbaVerbosePlain, "Initialization...\n" ); } m_bNoDraw = false; m_bHiddenDueToOtherElements = false; m_iCurrentPriority = 0; m_hLastSpectatedPlayer = NULL; m_bSpectatedPlayerChanged = false; m_szPreviousStartSound[0] = '\0'; m_fNextStartSoundTime = 0; ReadLessonsFromFile( GAMEINSTRUCTOR_MOD_SCRIPT_FILE ); ReadLessonsFromFile( GAMEINSTRUCTOR_SCRIPT_FILE ); InitLessonPrerequisites(); ReadSaveData(); ListenForGameEvent("gameinstructor_draw"); ListenForGameEvent("gameinstructor_nodraw"); ListenForGameEvent("round_end"); ListenForGameEvent("round_start"); ListenForGameEvent("player_death"); ListenForGameEvent("player_team"); ListenForGameEvent("player_disconnect"); ListenForGameEvent("map_transition"); ListenForGameEvent("game_newmap"); ListenForGameEvent("set_instructor_group_enabled"); EvaluateLessonsForGameRules(); return true; }
void CHudLessonPanel::Init() { HOOK_HUD_MESSAGE( CHudLessonPanel, HintText ); HOOK_MESSAGE( LessonLearned ); // listen for client side events ListenForGameEvent( "player_hintmessage" ); }
CPlayerSpawnCache::CPlayerSpawnCache() { // Clear the cache Reset(); // The only event we care about ListenForGameEvent( "game_newmap" ); }
void CHLTVDirector::SetHLTVServer( IHLTVServer *hltv ) { RemoveEventsFromHistory(-1); // all if ( hltv ) { m_pHLTVClient = UTIL_PlayerByIndex( hltv->GetHLTVSlot() + 1 ); if ( m_pHLTVClient && m_pHLTVClient->IsHLTV() ) { m_pHLTVServer = hltv; } else { m_pHLTVServer = NULL; Error( "Couldn't find HLTV client player." ); } // register for events the director needs to know ListenForGameEvent( "player_hurt" ); ListenForGameEvent( "player_death" ); ListenForGameEvent( "round_end" ); ListenForGameEvent( "round_start" ); ListenForGameEvent( "hltv_cameraman" ); ListenForGameEvent( "hltv_rank_entity" ); ListenForGameEvent( "hltv_rank_camera" ); } else { // deactivate HLTV director m_pHLTVServer = NULL; } }
void CDODDeathStatsPanel::Init() { Hide(); ListenForGameEvent( "player_death" ); m_iMaterialTexture = vgui::surface()->CreateNewTextureID(); CHudElement::Init(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CTFStatPanel::Init() { // listen for events HOOK_HUD_MESSAGE( CTFStatPanel, PlayerStatsUpdate ); ListenForGameEvent( "player_spawn" ); Hide(); CHudElement::Init(); }
bool CMumbleSystem::Init() { m_bHasSetPlayerUniqueId = false; m_nTeamSetInUniqueId = 0; m_szSteamIDCurrentServer[0] = '\0'; m_cubSteamIDCurrentServer = 0; ListenForGameEvent( "server_spawn" ); return true; }
bool CEventLog::Init() { ListenForGameEvent( "player_changename" ); ListenForGameEvent( "player_activate" ); ListenForGameEvent( "player_death" ); ListenForGameEvent( "player_team" ); ListenForGameEvent( "player_disconnect" ); ListenForGameEvent( "player_connect" ); ListenForGameEvent("player_hurt"); //BG2 - Added - HairyPotter return true; }
bool CEventLog::Init() { ListenForGameEvent( "player_changename" ); ListenForGameEvent( "player_activate" ); ListenForGameEvent( "player_death" ); ListenForGameEvent( "player_team" ); ListenForGameEvent( "player_disconnect" ); ListenForGameEvent( "player_connect" ); return true; }
CMomentumPlayer::CMomentumPlayer() : m_duckUntilOnGround(false), m_flStamina(0), m_flTicksOnGround(0), m_flLastVelocity(0), m_flLastSyncVelocity(0), m_nPerfectSyncTicks(0), m_nStrafeTicks(0), m_nAccelTicks(0), m_bPrevTimerRunning(false), m_nPrevButtons(0), m_nTicksInAir(0), m_flTweenVelValue(1.0f) { m_flPunishTime = -1; m_iLastBlock = -1; m_RunData.m_iRunFlags = 0; m_iShotsFired = 0; m_iDirection = 0; m_bResumeZoom = false; m_iLastZoom = 0; m_bDidPlayerBhop = false; m_iSuccessiveBhops = 0; m_bHasPracticeMode = false; ListenForGameEvent("mapfinished_panel_closed"); }
//------------------------------------------------------------------------------------------------------------- CFishPool::CFishPool( void ) { m_fishCount = 0; m_maxRange = 255.0f; m_swimDepth = 0.0f; m_isDormant = false; m_visTimer.Start( 0.5f ); ListenForGameEvent( "player_shoot" ); ListenForGameEvent( "player_footstep" ); ListenForGameEvent( "weapon_fire" ); ListenForGameEvent( "hegrenade_detonate" ); ListenForGameEvent( "flashbang_detonate" ); ListenForGameEvent( "smokegrenade_detonate" ); ListenForGameEvent( "bomb_exploded" ); }
/* LINK_ENTITY_TO_CLASS( team_train_watcher_master, CTeamTrainWatcherMaster ); PRECACHE_REGISTER( team_train_watcher_master ); CTeamTrainWatcherMaster::CTeamTrainWatcherMaster() { m_pBlueWatcher = NULL; m_pRedWatcher = NULL; m_flBlueProgress = 0.0f; m_flRedProgress = 0.0f; ListenForGameEvent( "teamplay_round_start" ); ListenForGameEvent( "teamplay_round_win" ); } CTeamTrainWatcherMaster::~CTeamTrainWatcherMaster() { if ( g_hTeamTrainWatcherMaster.Get() == this ) { g_hTeamTrainWatcherMaster = NULL; } } void CTeamTrainWatcherMaster::Precache( void ) { PrecacheScriptSound( TWM_FIRSTSTAGEOUTCOME01 ); PrecacheScriptSound( TWM_FIRSTSTAGEOUTCOME02 ); PrecacheScriptSound( TWM_RACEGENERAL01 ); PrecacheScriptSound( TWM_RACEGENERAL02 ); PrecacheScriptSound( TWM_RACEGENERAL03 ); PrecacheScriptSound( TWM_RACEGENERAL04 ); PrecacheScriptSound( TWM_RACEGENERAL05 ); PrecacheScriptSound( TWM_RACEGENERAL08 ); PrecacheScriptSound( TWM_RACEGENERAL06 ); PrecacheScriptSound( TWM_RACEGENERAL07 ); PrecacheScriptSound( TWM_RACEGENERAL09 ); PrecacheScriptSound( TWM_RACEGENERAL12 ); PrecacheScriptSound( TWM_RACEGENERAL13 ); PrecacheScriptSound( TWM_RACEGENERAL14 ); PrecacheScriptSound( TWM_RACEGENERAL15 ); PrecacheScriptSound( TWM_RACEGENERAL10 ); PrecacheScriptSound( TWM_RACEGENERAL11 ); PrecacheScriptSound( TWM_SECONDSTAGEOUTCOME01 ); PrecacheScriptSound( TWM_SECONDSTAGEOUTCOME04 ); PrecacheScriptSound( TWM_SECONDSTAGEOUTCOME02 ); PrecacheScriptSound( TWM_SECONDSTAGEOUTCOME03 ); PrecacheScriptSound( TWM_FINALSTAGEOUTCOME01 ); PrecacheScriptSound( TWM_FINALSTAGEOUTCOME02 ); PrecacheScriptSound( TWM_FINALSTAGESTART01 ); PrecacheScriptSound( TWM_FINALSTAGESTART04 ); PrecacheScriptSound( TWM_FINALSTAGESTART08 ); PrecacheScriptSound( TWM_FINALSTAGESTART09 ); PrecacheScriptSound( TWM_FINALSTAGESTART07 ); PrecacheScriptSound( TWM_FINALSTAGESTART02 ); PrecacheScriptSound( TWM_FINALSTAGESTART03 ); PrecacheScriptSound( TWM_FINALSTAGESTART05 ); PrecacheScriptSound( TWM_FINALSTAGESTART06 ); BaseClass::Precache(); } bool CTeamTrainWatcherMaster::FindTrainWatchers( void ) { m_pBlueWatcher = NULL; m_pRedWatcher = NULL; // find the train_watchers for this round CTeamTrainWatcher *pTrainWatcher = (CTeamTrainWatcher *)gEntList.FindEntityByClassname( NULL, "team_train_watcher" ); while ( pTrainWatcher ) { if ( pTrainWatcher->IsDisabled() == false ) { if ( pTrainWatcher->GetTeamNumber() == TF_TEAM_BLUE ) { m_pBlueWatcher = pTrainWatcher; } else if ( pTrainWatcher->GetTeamNumber() == TF_TEAM_RED ) { m_pRedWatcher = pTrainWatcher; } } pTrainWatcher = (CTeamTrainWatcher *)gEntList.FindEntityByClassname( pTrainWatcher, "team_train_watcher" ); } return ( m_pBlueWatcher && m_pRedWatcher ); } void CTeamTrainWatcherMaster::TWMThink( void ) { if ( TeamplayRoundBasedRules() && TeamplayRoundBasedRules()->State_Get() != GR_STATE_RND_RUNNING ) { // the next time we 'think' SetContextThink( &CTeamTrainWatcherMaster::TWMThink, gpGlobals->curtime + 0.2, TWMASTER_THINK ); return; } // the next time we 'think' SetContextThink( &CTeamTrainWatcherMaster::TWMThink, gpGlobals->curtime + 0.2, TWMASTER_THINK ); } void CTeamTrainWatcherMaster::FireGameEvent( IGameEvent *event ) { const char *eventname = event->GetName();` if ( FStrEq( "teamplay_round_start", eventname ) ) { if ( TeamplayRoundBasedRules() && TeamplayRoundBasedRules()->HasMultipleTrains() ) { if ( FindTrainWatchers() ) { // we found train watchers so start thinking SetContextThink( &CTeamTrainWatcherMaster::TWMThink, gpGlobals->curtime + 0.2, TWMASTER_THINK ); } } } else if ( FStrEq( "teamplay_round_win", eventname ) ) { if ( TeamplayRoundBasedRules() ) { int iWinningTeam = event->GetInt( "team" ); int iLosingTeam = ( iWinningTeam == TF_TEAM_RED ) ? TF_TEAM_BLUE : TF_TEAM_RED; bool bFullRound = event->GetBool( "full_round" ); CTeamRecipientFilter filterWinner( iWinningTeam, true ); CTeamRecipientFilter filterLoser( iLosingTeam, true ); if ( bFullRound ) { EmitSound( filterWinner, entindex(), TWM_FINALSTAGEOUTCOME01 ); EmitSound( filterLoser, entindex(), TWM_FINALSTAGEOUTCOME02 ); } else { EmitSound( filterWinner, entindex(), TWM_FIRSTSTAGEOUTCOME01 ); EmitSound( filterLoser, entindex(), TWM_FIRSTSTAGEOUTCOME02 ); } } } } */ CTeamTrainWatcher::CTeamTrainWatcher() { m_bDisabled = false; m_flRecedeTime = 0; m_bWaitingToRecede = false; m_bCapBlocked = false; m_flNextSpeakForwardConceptTime = 0; m_hAreaCap = NULL; m_bTrainCanRecede = true; m_bAlarmPlayed = false; m_pAlarm = NULL; m_flAlarmEndTime = -1; m_bHandleTrainMovement = false; m_flSpeedForwardModifier = 1.0f; m_iCurrentHillType = HILL_TYPE_NONE; m_flCurrentSpeed = 0.0f; m_bReceding = false; m_flTrainDistanceFromStart = 0.0f; m_nTrainRecedeTime = 0; #ifdef GLOWS_ENABLE m_hGlowEnt.Set( NULL ); #endif // GLOWS_ENABLE #ifdef TF_DLL ChangeTeam( TF_TEAM_BLUE ); #else ChangeTeam( TEAM_UNASSIGNED ); #endif /* // create a CTeamTrainWatcherMaster entity if ( g_hTeamTrainWatcherMaster.Get() == NULL ) { g_hTeamTrainWatcherMaster = CreateEntityByName( "team_train_watcher_master" ); } */ ListenForGameEvent( "path_track_passed" ); }
void C_HLTVCamera::Init() { ListenForGameEvent( "game_newmap" ); ListenForGameEvent( "hltv_cameraman" ); ListenForGameEvent( "hltv_fixed" ); ListenForGameEvent( "hltv_chase" ); ListenForGameEvent( "hltv_message" ); ListenForGameEvent( "hltv_title" ); ListenForGameEvent( "hltv_status" ); Reset(); m_nNumSpectators = 0; m_szTitleText[0] = 0; // get a handle to the engine convar tv_transmitall = cvar->FindVar( "tv_transmitall" ); }
void ClientModeDODNormal::Init() { BaseClass::Init(); ListenForGameEvent( "dod_round_start" ); ListenForGameEvent( "dod_broadcast_audio" ); ListenForGameEvent( "player_team" ); ListenForGameEvent( "dod_bomb_planted" ); ListenForGameEvent( "dod_bomb_defused" ); ListenForGameEvent( "dod_timer_flash" ); usermessages->HookMessage( "KillCam", MsgFunc_KillCam ); m_szLastRadioSound[0] = '\0'; }
virtual void ListenForEvents() { ListenForGameEvent( "round_end" ); }
virtual void ListenForEvents() { ListenForGameEvent("player_hurt"); VarInit(); }
virtual void ListenForEvents() { ListenForGameEvent( "weapon_event" ); ListenForGameEvent( "player_spawn" ); VarInit(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- C_VoteController::C_VoteController() { ResetData(); ListenForGameEvent( "vote_cast" ); }
virtual void ListenForEvents() { ListenForGameEvent( "flare_ignite_npc" ); }
virtual void ListenForEvents() { ListenForGameEvent( "physgun_pickup" ); }