MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / Initialize

Method Initialize

extensions/sdktools/hooks.cpp:80–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void CHookManager::Initialize()
81{
82 int offset;
83 if (g_pGameConf->GetOffset("PlayerRunCmd", &offset))
84 {
85 SH_MANUALHOOK_RECONFIGURE(PlayerRunCmdHook, offset, 0, 0);
86 PRCH_enabled = true;
87 }
88 else
89 {
90 g_pSM->LogError(myself, "Failed to find PlayerRunCmd offset - OnPlayerRunCmd forward disabled.");
91 PRCH_enabled = false;
92 }
93
94 basefilesystemPatch = SH_GET_CALLCLASS(basefilesystem);
95
96 m_netFileSendFwd = forwards->CreateForward("OnFileSend", ET_Event, 2, NULL, Param_Cell, Param_String);
97 m_netFileReceiveFwd = forwards->CreateForward("OnFileReceive", ET_Event, 2, NULL, Param_Cell, Param_String);
98
99 plsys->AddPluginsListener(this);
100 sharesys->AddCapabilityProvider(myself, this, FEATURECAP_PLAYERRUNCMD_11PARAMS);
101
102 m_usercmdsPreFwd = forwards->CreateForward("OnPlayerRunCmdPre", ET_Ignore, 11, NULL,
103 Param_Cell, // int client
104 Param_Cell, // int buttons
105 Param_Cell, // int impulse
106 Param_Array, // float vel[3]
107 Param_Array, // float angles[3]
108 Param_Cell, // int weapon
109 Param_Cell, // int subtype
110 Param_Cell, // int cmdnum
111 Param_Cell, // int tickcount
112 Param_Cell, // int seed
113 Param_Array); // int mouse[2]
114
115 m_usercmdsFwd = forwards->CreateForward("OnPlayerRunCmd", ET_Event, 11, NULL,
116 Param_Cell, // client
117 Param_CellByRef, // buttons
118 Param_CellByRef, // impulse
119 Param_Array, // Float:vel[3]
120 Param_Array, // Float:angles[3]
121 Param_CellByRef, // weapon
122 Param_CellByRef, // subtype
123 Param_CellByRef, // cmdnum
124 Param_CellByRef, // tickcount
125 Param_CellByRef, // seed
126 Param_Array); // mouse[2]
127
128 m_usercmdsPostFwd = forwards->CreateForward("OnPlayerRunCmdPost", ET_Ignore, 11, NULL,
129 Param_Cell, // client
130 Param_Cell, // buttons
131 Param_Cell, // impulse
132 Param_Array, // Float:vel[3]
133 Param_Array, // Float:angles[3]
134 Param_Cell, // weapon
135 Param_Cell, // subtype
136 Param_Cell, // cmdnum
137 Param_Cell, // tickcount

Callers 2

SDK_OnAllLoadedMethod · 0.45
SlapPlayerFunction · 0.45

Calls 5

CreateForwardMethod · 0.80
AddCapabilityProviderMethod · 0.80
GetOffsetMethod · 0.45
LogErrorMethod · 0.45
AddPluginsListenerMethod · 0.45

Tested by

no test coverage detected