#pragma semicolon 1
#include <sdktools>
#include <dhooks>
Address IVModelRender;
Handle hDrawModelExecute;
public void OnPluginStart()
{
StartPrepSDKCall(SDKCall_Static);
PrepSDKCall_SetSignature(SDKLibrary_Engine, "@CreateInterface", 0);
PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer);
PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Pointer, VDECODE_FLAG_ALLOWNULL);
PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain);
Handle call = EndPrepSDKCall();
IVModelRender = SDKCall(call, "VEngineModel016", 0);
CloseHandle(call);
PrintToServer("IVModelRender %x", IVModelRender);
//21(WIN 22) CModelRender::DrawModelExecute(IMatRenderContext *,DrawModelState_t const&,ModelRenderInfo_t const&,matrix3x4_t *)
hDrawModelExecute = DHookCreate(21, HookType_Raw, ReturnType_Void, ThisPointer_Ignore, DrawModelExecute);
DHookAddParam(hDrawModelExecute, HookParamType_Int); //IMatRenderContext
DHookAddParam(hDrawModelExecute, HookParamType_Int); //DrawModelState_t
DHookAddParam(hDrawModelExecute, HookParamType_Int); //ModelRenderInfo_t
DHookAddParam(hDrawModelExecute, HookParamType_Int); //matrix3x4_t
DHookRaw(hDrawModelExecute, false, IVModelRender);
}
public MRESReturn DrawModelExecute(Handle hParams)
{
PrintToServer("DrawModelExecute");
return MRES_Ignored;
}