Raised This Month: $ Target: $400
 0% 

pfn_keyvalue in fakemeta


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
commonbullet
Veteran Member
Join Date: Oct 2005
Old 07-06-2006 , 18:47   pfn_keyvalue in fakemeta
Reply With Quote #1

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…
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
Zenith77
Veteran Member
Join Date: Aug 2005
Old 07-06-2006 , 19:17   Re: pfn_keyvalue in fakemeta
Reply With Quote #2

Post your code please.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
commonbullet
Veteran Member
Join Date: Oct 2005
Old 07-06-2006 , 23:05   Re: pfn_keyvalue in fakemeta
Reply With Quote #3

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.

Last edited by commonbullet; 07-06-2006 at 23:09.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
VEN
Veteran Member
Join Date: Jan 2005
Old 07-07-2006 , 08:20   Re: pfn_keyvalue in fakemeta
Reply With Quote #4

Quote:
I also tried to register the forward in plugin_precache, but it didn't work
Try again, this should work.
VEN is offline
commonbullet
Veteran Member
Join Date: Oct 2005
Old 07-07-2006 , 15:28   Re: pfn_keyvalue in fakemeta
Reply With Quote #5

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.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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