Hi, with help of @peace-maker and @Pelipoika i've got the solution for that
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <dhooks>
// CItem_Healthshot::CompleteUse(CCSPlayer *) (probably returns void)
Handle hHealthshotCompleteUse;
int offsetHealthshotCompleteUse;
public OnPluginStart()
{
Handle temp = LoadGameConfigFile("healthshot.games");
if(temp == INVALID_HANDLE)
SetFailState("Missing healthshot.games file in gamedata folder.");
offsetHealthshotCompleteUse = GameConfGetOffset(temp, "CompleteUse");
if(offsetHealthshotCompleteUse == -1)
SetFailState("Failed to get offset from healthshot.games file.");
CloseHandle(temp);
hHealthshotCompleteUse = DHookCreate(offsetHealthshotCompleteUse, HookType_Entity, ReturnType_Void, ThisPointer_CBaseEntity, HealthshotCompleteUse);
DHookAddParam(hHealthshotCompleteUse, HookParamType_CBaseEntity);
}
public OnEntityCreated(int entity, const char[] classname)
{
if (StrEqual(classname, "weapon_healthshot"))
{
DHookEntity(hHealthshotCompleteUse, true, entity);
}
}
public MRESReturn HealthshotCompleteUse(pThis, Handle hParams)
{
int client = DHookGetParam(hParams, 1);
//Here you can do some stuff with client who used healthshot :)
return MRES_Ignored;
}
and current offsets for this
Code:
"Games"
{
"csgo"
{
"Offsets"
{
"CompleteUse"
{
"windows" "453"
"linux" "459"
}
}
}
}