AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   pfn_keyvalue in fakemeta (https://forums.alliedmods.net/showthread.php?t=40956)

commonbullet 07-06-2006 18:47

pfn_keyvalue in fakemeta
 
Is there a way to replace engine’s pfn_keyvalue forward with a fakemeta equivalent?
I’ve tried to hook
Code:
 register_forward(FM_KeyValue, "myfunction")
; it didn’t seem to work…

Zenith77 07-06-2006 19:17

Re: pfn_keyvalue in fakemeta
 
Post your code please.

commonbullet 07-06-2006 23:05

Re: pfn_keyvalue in fakemeta
 
Indeed there's no code, I just made the following test, nothing is printed (the function is not called).
Code:
public plugin_init() {     register_forward(FM_KeyValue, "fm_keyvalue") } public fm_keyvalue(entid) {     server_print("entity: %d", entid) }

Engine's pfn_keyvalue function is called before plugin_init; so registering it in plugin_init is not a good idea. I also tried to register the forward in plugin_precache, but it didn't work.

VEN 07-07-2006 08:20

Re: pfn_keyvalue in fakemeta
 
Quote:

I also tried to register the forward in plugin_precache, but it didn't work
Try again, this should work.

commonbullet 07-07-2006 15:28

Re: pfn_keyvalue in fakemeta
 
You’re right, it works. I'm sorry I haven’t found that thread before which fully answers my post:
http://forums.alliedmods.net/showthr...hlight=get_kvd

Thank you.


All times are GMT -4. The time now is 07:56.

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