void OnSourceModStartup(bool late) override { #if SOURCE_ENGINE >= SE_ORANGEBOX g_pCVar = icvar; #endif CONVAR_REGISTER(this); }
void RootConsoleMenu::OnSourceModStartup(bool late) { #if defined ORANGEBOX_BUILD g_pCVar = icvar; #endif CONVAR_REGISTER(this); AddRootConsoleCommand("version", "Display version information", this); AddRootConsoleCommand("credits", "Display credits listing", this); }
bool SDKTools::SDK_OnLoad(char *error, size_t maxlength, bool late) { HandleError err; if (!gameconfs->LoadGameConfigFile("sdktools.games", &g_pGameConf, error, maxlength)) { return false; } sharesys->AddDependency(myself, "bintools.ext", true, true); sharesys->AddNatives(myself, g_CallNatives); sharesys->AddNatives(myself, g_Natives); sharesys->AddNatives(myself, g_TENatives); sharesys->AddNatives(myself, g_SoundNatives); sharesys->AddNatives(myself, g_TRNatives); sharesys->AddNatives(myself, g_StringTableNatives); sharesys->AddNatives(myself, g_VoiceNatives); sharesys->AddNatives(myself, g_EntInputNatives); sharesys->AddNatives(myself, g_TeamNatives); sharesys->AddNatives(myself, g_EntOutputNatives); sharesys->AddNatives(myself, g_GameRulesNatives); sharesys->AddNatives(myself, g_ClientNatives); SM_GET_IFACE(GAMEHELPERS, g_pGameHelpers); playerhelpers->AddClientListener(&g_SdkTools); g_CallHandle = handlesys->CreateType("ValveCall", this, 0, NULL, NULL, myself->GetIdentity(), &err); if (g_CallHandle == 0) { snprintf(error, maxlength, "Could not create call handle type (err: %d)", err); return false; } TypeAccess TraceAccess; handlesys->InitAccessDefaults(&TraceAccess, NULL); TraceAccess.ident = myself->GetIdentity(); TraceAccess.access[HTypeAccess_Create] = true; TraceAccess.access[HTypeAccess_Inherit] = true; g_TraceHandle = handlesys->CreateType("TraceRay", this, 0, &TraceAccess, NULL, myself->GetIdentity(), &err); if (g_TraceHandle == 0) { handlesys->RemoveType(g_CallHandle, myself->GetIdentity()); g_CallHandle = 0; snprintf(error, maxlength, "Could not create traceray handle type (err: %d)", err); return false; } #if SOURCE_ENGINE >= SE_ORANGEBOX g_pCVar = icvar; #endif CONVAR_REGISTER(this); SH_ADD_HOOK(IServerGameDLL, LevelInit, gamedll, SH_MEMBER(this, &SDKTools::LevelInit), true); playerhelpers->RegisterCommandTargetProcessor(this); MathLib_Init(2.2f, 2.2f, 0.0f, 2); spengine = g_pSM->GetScriptingEngine(); plsys->AddPluginsListener(&g_OutputManager); CDetourManager::Init(g_pSM->GetScriptingEngine(), g_pGameConf); g_OutputManager.Init(); VoiceInit(); GetIServer(); GameRulesNativesInit(); InitSDKToolsAPI(); return true; }