Found server crash:
Code:
GAMEDATA:
"Games"
{
"csgo"
{
"Offsets"
{
"AcceptInput"
{
"windows" "40"
"linux" "41"
}
}
}
}
CODE:
#pragma semicolon 1
#include <sourcemod>
#include <dhooks>
#pragma newdecls required
Handle hAcceptInput;
public void OnPluginStart()
{
Handle conf = LoadGameConfigFile("acceptinput.games");
if(conf == INVALID_HANDLE) {
SetFailState("No gamedata?");
}
int offset = GameConfGetOffset(conf, "AcceptInput");
hAcceptInput = DHookCreate(offset, HookType_Entity, ReturnType_Bool, ThisPointer_CBaseEntity, AcceptInput);
DHookAddParam(hAcceptInput, HookParamType_CharPtr);
DHookAddParam(hAcceptInput, HookParamType_CBaseEntity);
DHookAddParam(hAcceptInput, HookParamType_CBaseEntity);
DHookAddParam(hAcceptInput, HookParamType_Object, 20); //varaint_t is a union of 12 (float[3]) plus two int type params 12 + 8 = 20
DHookAddParam(hAcceptInput, HookParamType_Int);
}
public void OnEntityCreated (int entity, const char[] classname)
{
if(StrEqual(classname, "player_weaponstrip", false))
DHookEntity(hAcceptInput, false, entity);
}
public MRESReturn AcceptInput(int pThis, Handle hReturn, Handle hParams)
{
return MRES_Ignored; // no matter what I put in here it crashes
}
Tested map: Pick football in mg_yolo_multigames_v1 = insta-crash.