According to these Sourcemod docs we can block events and they give this example to block headshots.
https://wiki.alliedmods.net/Events_(...Mod_Scripting)
I adding the logging line and built this for CSGO
and the “Blocking Headshot “ message is printed to the console when a player takes a headshot but it doesn’t block the headshots.
PHP Code:
public void OnPluginStart()
{
HookEvent("player_death", Event_PlayerDeath, EventHookMode_Pre);
}
public Action Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast)
{
if (event.GetBool("headshot"))
{
PrintToServer("Blocking Headshot");
return Plugin_Handled;
}
return Plugin_Continue;
}
I am interested in blocking these events and tried blocking them the same way (both Pre and Post) and no events are ever blocked.
round_end
hostage_rescued
hostage_rescued_all
Is there something different we have to do for CSGO to block events?