Hi,
I need to catch a moment of explosion and get molotov entity coordinates.
This code work for "pipe_bomb_projectile", but doesn't trigger for "weapon_molotov" (only "other" touch raise in some cases).
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
public void OnEntityCreated(int entity, const char[] classname)
{
PrintToChatAll("Entity created: %s", classname);
if(StrEqual(classname, "weapon_molotov"))
//if(StrEqual(classname, "pipe_bomb_projectile"))
{
SDKHook(entity, SDKHook_StartTouch, OnTouch);
}
}
public void OnTouch(int entity, int other)
{
if (!other)
{
PrintToChatAll("touched");
}
else {
PrintToChatAll("Other touch");
}
SDKUnhook(entity, SDKHook_StartTouch, OnTouch);
}
btw, what is mean "other" parameter?
Possibly, I could use HookSingleEntityOutput, but I can't see in
valve dev. any docs about the list of output names. Any help?
Also, maybe, I could use OnEntityDestroyed, but I need somehow check the reason why molotov is destroyed to ensure it is happen due to explosion.
It is also, an "inferno" entity created after explosion, so as a final walkaround I could use its origin. However, it is required that I check inferno spawned due to molotov explosion.
Thanks.
__________________