View Single Post
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 11-29-2019 , 00:44   Re: [TF2] halloween_skeleton_killed Event Not Firing?
Reply With Quote #2

I couldn't get it to fire either using the code below. I was on koth_lakeside_event, spawned all bosses and skeletons using bossspawns.

Hook Events not working: "halloween_skeleton_killed" and "halloween_boss_killed"
Hook Event working: "escaped_loot_island"

PHP Code:
#pragma semicolon 1

public Plugin:myinfo = {
    
name         "Test of Skeleton Death",
    
author         "PC Gamer",
    
description "Tests the firing of events",
    
version     "1.0",
    
url         "http://www.sourcemod.net"
};

public 
OnPluginStart()
{
    
HookEvent("halloween_skeleton_killed"OnSkeletonDeathEventHookMode_Post);
    
HookEvent("halloween_boss_killed"OnBossDeathEventHookMode_Post);
    
HookEvent("escaped_loot_island"OnEscapeIslandEventHookMode_Post);        
}

public 
OnMapEnd()
{
    
UnhookEvent("halloween_skeleton_killed"OnSkeletonDeath);
    
UnhookEvent("halloween_boss_killed"OnBossDeath);
    
UnhookEvent("escaped_loot_island"OnEscapeIsland);    
}

public 
Action:OnSkeletonDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event,"player"));
    
PrintToChatAll("Event Fired: halloween_skeleton_killed");
    
PrintToChatAll("Event Notice: Skeleton was killed by %N"client);
    
PrintToServer("Event Notice: Skeleton was killed by %N"client);    
}


public 
Action:OnBossDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event,"killer"));
    
int bosstype GetEventInt(event,"boss");
    
PrintToChatAll("Event Fired: halloween_boss_killed");    
    
PrintToChatAll("Event Notice: Boss Type: %i was killed by %N"bosstypeclient);
    
PrintToServer("Event Notice: Boss Type: %i was killed by %N"bosstype,client);    
}

public 
Action:OnEscapeIsland(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event,"player"));
    
PrintToChatAll("Event Fired: escaped_loot_island");    
    
PrintToChatAll("Event Notice: %N Escaped Loot Island"client);
    
PrintToServer("Event Notice: %N Escaped Loot Island"client);    

PC Gamer is offline