AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Precache called after FM registered forwards? (https://forums.alliedmods.net/showthread.php?t=10778)

Twilight Suzuka 02-28-2005 19:46

Precache called after FM registered forwards?
 
Ok, I've been trying to BLOCK some of the precaching and setmodel commands, but I've been having a strange problem. In TS, when I simply tell the plugin to tell me whenever things are precached, instead of a huge list of precached things at the beginning and nothing after, it tells me it continues precaching powerup.mdl over and over. And nothing else.

Code:
#include <amxmodx> #include <engine> #include <fakemeta> public plugin_init() {     register_plugin("Precache Info","1.17","Melanie")     register_forward(FM_PrecacheModel,"model_handle",0); } public plugin_modules(){     require_module("Engine");     require_module("FakeMeta"); } public model_handle(str[]){     server_print("Model %s precached",str);     return FMRES_SUPERCEDE }


I tried to register it sooner, in plugin_modules, but even though it didnt crash, it gave me the same thing. Any idea on how I could capture the precache signals before its actually precached?

Twilight Suzuka 02-28-2005 20:09

Ok I figured it out. Heres what I did:
Code:
#include <amxmodx> #include <engine> #include <fakemeta> public plugin_init() {     register_plugin("Unprecacher","1.17","Melanie") } public plugin_precache() register_forward(FM_PrecacheModel,"model_handle"); public plugin_modules(){     require_module("Engine");     require_module("FakeMeta"); } public model_handle(str[]){     server_print("Model %s precached",str);     return FMRES_OVERRIDE }

I registered the forward ON the precache function. Now, this confuses me, because:
Quote:

plugin_precache - Called after plugin_cfg
And also:
Quote:

plugin_cfg - Called after plugin_init has been called
Ok, so precache is called after cfg, and cfgg is called after init, and yet the evidence points towards init being called AFTER precache, thus AFTER cfg.

Pretty strange, in my opinion.


All times are GMT -4. The time now is 14:09.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.