Quote:
Originally Posted by PRoSToTeM@
plugin_precache is useful for hooking WeaponList via register_message which requires get_user_msgid call.
|
Nope:
PHP Code:
#include <amxmodx>
public plugin_precache()
{
log_amx("%i", register_message(get_user_msgid("WeaponList"), "TestFunc"))
}
public TestFunc()
{
static i; i++
log_amx("test success %i", i)
}
Prints 0 on server start.
Prints 1 and "test success" 29 times after server restart or mapchange.
I already submitted a pull request to add a warning for this function in the documentation -
https://github.com/alliedmodders/amxmodx/pull/506
Correct me if there's indeed a bug that needs to be fixed.
__________________