Veteran Member
Join Date: Jul 2006
Location: France (95)
|
08-10-2013
, 16:39
Re: [INFO] TFC PrecacheEvent/PlaybackEvent Index and Name List
|
#4
|
On cs, you can send all precache_event at plugin_init instead of hooking the fonction from plugin_precache to plugin_init.
When i have tested this, server crashed at firs EngFunc_PrecacheEvent call.
Maybe you gonna have more chance than me :
Spoiler
PHP Code:
#include < amxmodx > #include < fakemeta >
#pragma semicolon 1
#define PLUGIN "" #define VERSION "0.0.1"
new g_iFwd;
new Trie:g_tLog;
public plugin_precache() { g_tLog = TrieCreate(); g_iFwd = register_forward(FM_PrecacheEvent, "OnPrecacheEvent_P", 1); }
public OnPrecacheEvent_P(type, event[]) { if( !TrieKeyExists(g_tLog, event) ) { TrieSetCell(g_tLog, event, 1); log_to_file("tfc_events.log", "Hook %s^t^t%d", event, get_orig_retval()); } }
public plugin_init() { register_plugin( PLUGIN, VERSION, "ConnorMcLeod" ); unregister_forward(FM_PrecacheEvent, g_iFwd, 1); TrieDestroy(g_tLog);
new const events[][] = { "door/doorgodown.sc", "door/doorgoup.sc", "door/doorhitbottom.sc", "door/doorhittop.sc", "explode/tf_burn.sc", "explode/tf_concuss.sc", "explode/tf_emp.sc", "explode/tf_engrgren.sc", "explode/tf_fire.sc", "explode/tf_gas.sc", "explode/tf_gren.sc", "explode/tf_mirv.sc", "explode/tf_mirvmain.sc", "explode/tf_nailgren.sc", "explode/tf_ng.sc", "explode/tf_normalgren.sc", "explode/tf_pipe.sc", "misc/benchmark.sc", "misc/gibs.sc", "misc/tf_buildingevent.sc", "wpn/tf_acfire.sc", "wpn/tf_acspin.sc", "wpn/tf_acsspin.sc", "wpn/tf_acstart.sc", "wpn/tf_acwd.sc", "wpn/tf_acwu.sc", "wpn/tf_ar.sc", "wpn/tf_axe.sc", "wpn/tf_axedecal.sc", "wpn/tf_flame.sc", "wpn/tf_gl.sc", "wpn/tf_ic.sc", "wpn/tf_knife.sc", "wpn/tf_mednormal.sc", "wpn/tf_medsteam.sc", "wpn/tf_medsuper.sc", "wpn/Tf_nail.sc", "wpn/tf_pipel.sc", "wpn/tf_rail.sc", "wpn/tf_rpg.sc", "wpn/Tf_sg.sc", "wpn/tf_sgpump.sc", "wpn/tf_sgreload.sc", "wpn/tf_snail.sc", "wpn/tf_sniper.sc", "wpn/tf_sniperhit.sc", "wpn/tf_ssg.sc", "wpn/tf_tranq.sc" };
new ret; for(new i; i<sizeof(events); i++) { ret = engfunc(EngFunc_PrecacheEvent, 1, events[i]); log_to_file("tfc_events.log", "Call %s^t^t%d", events[i], ret); } }
__________________
Last edited by ConnorMcLeod; 08-10-2013 at 16:41.
|
|