This is a list of event names and indexes used with the PrecacheEvent and PlaybackEvent forwards in Team Fortress Classic. I ultimately didn't end up using any of this in the plugin I was coding, but I figured someone else might find this information helpful.
In theory the event IDs could change, and you should get them programatically in plugin_precache().
Code:
# Event Name Comment
1 = events/wpn/tf_sg.sc Single-Barrel Shotgun (Scout, Soldier, Pyro, Demoman, Heavy Weapons Guy, Medic)
2 = events/wpn/tf_sgreload.sc Both shotguns reload
3 = events/wpn/tf_sgpump.sc Both shotguns pump
4 = events/wpn/tf_axe.sc Knife (Spy), Medkit (Medic), Umbrella (Civilian)
5 = events/wpn/tf_axedecal.sc ??
6 = events/wpn/tf_knife.sc ?? (Spy)
7 = events/wpn/tf_mednormal.sc ?? (Medic)
8 = events/wpn/tf_medsuper.sc ?? (Medic)
9 = events/wpn/tf_medsteam.sc ?? (Medic)
10 = events/wpn/tf_nail.sc Nailgun (Spy, Sniper, Scout)
11 = events/wpn/tf_snail.sc Super Nailgun (Medic)
12 = events/wpn/tf_rpg.sc Rocket Launcher (Soldier)
13 = events/wpn/tf_ic.sc Incendiary Cannon (Pyro)
14 = events/wpn/tf_flame.sc Flamethrower (Pyro)
15 = events/wpn/tf_tranq.sc Tranquilizer Gun (Spy)
16 = events/wpn/tf_sniper.sc Sniper Rifle laser on (Sniper)
17 = events/wpn/tf_sniperhit.sc Sniper Rifle laser off/fire (Sniper)
18 = events/wpn/tf_ar.sc Automatic Rifle (Sniper)
19 = events/wpn/tf_rail.sc Railgun (Engineer)
20 = events/wpn/tf_acwu.sc Assault Cannon spin up (Heavy Weapons Guy)
21 = events/wpn/tf_acwd.sc Assault Cannon spin down (Heavy Weapons Guy)
22 = events/wpn/tf_acfire.sc Assault Cannon fire 1 round (Heavy Weapons Guy)
23 = events/wpn/tf_acsspin.sc Assault Cannon out of ammo (Heavy Weapons Guy)
24 = events/wpn/tf_acspin.sc Assault Cannon spin (no ammo) (Heavy Weapons Guy)
25 = events/wpn/tf_acstart.sc Assault Cannon start shooting (Heavy Weapons Guy)
26 = events/wpn/tf_gl.sc Grenade Launcher (Demoman)
27 = events/wpn/tf_pipel.sc Pipebomb Launcher (Demoman)
28 = events/wpn/tf_ssg.sc Double-Barrel Shotgun (Soldier, Heavy Weapons Guy, Medic, Engineer, Spy)
29 = events/misc/tf_buildingevent.sc Build/dismantle/detonate (Engineer)
30 = events/explode/tf_concuss.sc Concussion Grenade (Scout, Medic)
31 = events/explode/tf_emp.sc EMP Grenade (Engineer)
32 = events/explode/tf_pipe.sc Pipebomb Launcher detonation (Demoman)
33 = events/explode/tf_gren.sc Grenade Launcher detonation (Demoman)
34 = events/explode/tf_engrgren.sc ??
35 = events/explode/tf_normalgren.sc Hand grenade (All except Scout/Civilian)
36 = events/explode/tf_mirvmain.sc MIRV grenade initial explosion (Heavy Weapons Guy, Demoman)
37 = events/explode/tf_mirv.sc MIRV grenade little explosions (Heavy Weapons Guy, Demoman)
38 = events/explode/tf_fire.sc Napalm Grenade initial explosion (Pyro)
39 = events/explode/tf_burn.sc Napalm Grenade fire (Pyro)
40 = events/explode/tf_gas.sc Halucination Grenade (Spy)
41 = events/explode/tf_nailgren.sc Nail Grenade (Soldier) 1 round of nails
42 = events/explode/tf_ng.sc Nail Grenade (Soldier) terminating blast
43 = events/misc/gibs.sc ??
44 = events/door/doorgoup.sc Door/gate/lift opening
45 = events/door/doorgodown.sc Door/gate/lift closing
46 = events/door/doorhittop.sc Door/gate/lift fully open
47 = events/door/doorhitbottom.sc Door/gate/lift fully closed
Here's some sample code for logging the events and blocking a specific one:
PHP Code:
#include <amxmodx>
#include <fakemeta>
public plugin_init() {
register_forward(FM_PlaybackEvent, "fw_playbackevent_pre", 0);
}
public plugin_precache() {
register_forward(FM_PrecacheEvent, "fw_precacheevent_post", 1);
}
public fw_playbackevent_pre(flags, invoker, eventindex, delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iparam1, iparam2, bparam1, bparam2) {
if (eventindex != 35) { // If it isn't the hand grenade event, ignore it
return FMRES_IGNORED;
}
log_amx("Grenade explosion blocked.");
return FMRES_SUPERCEDE; // This blocks the visual/sound effects, but not the actual damage
}
public fw_precacheevent_post(type, const event_name[]) {
log_amx("fw_precacheevent_post: event_name(%s) eventindex(%d)", event_name, get_orig_retval());
return FMRES_IGNORED;
}
See also
this post by VEN which demonstrates how to programmatically get the index (event ID) when you know the event/script name.
If anyone can provide more details on #5-9, 34, or 43, (or knows if there are any above 47,) please reply and I'll update this post.
--
Andy