register_forward(FM_SetKeyValue, ...) ?
I cant make the register_forward(FM_SetKeyValue,..) to work; it seems to not catch the SetKeyValue() function. Am I missing something?
I have this: Code:
I got no logging at all.. Thx |
First off, that formatting thing you do is bad. bad!
log_amx does formatting for you. so do: Code:
Otherwise, your code is much less efficient (zeroing the fmt buffer on the stack, formatting into that buffer, then letting log_amx go through the entire output again) and fragile (imagine that infobuffer contained "%s", then the output from formatex in fmt would also contain "%s", so log_amx would look for a subsequent string parameter - it wouldn't find it and you'd get a runtime error). Okay, to your actual issue.. The HLSdk doesn't use this function at all; I don't know what it does; probably the gamedll could tell the engine to set a keyvalue on an entity.. whatever :) Most likely you want pfnKeyValue from DLL_FUNCTIONS or maybe pfnInfoKeyValue from enginefuncs_s. |
pm is teh smart :o
|
Is that mean I cant catch that function at all?
I need to catch it for a way to communicate from one plugin to another. 1st plugin: modify entities; moving, rotating, etc 2nd plugin: create special entities but need to know when 1st plugin modify the keys of entities created by the 2nd. How can I achieve this? |
DispatchKeyValue doesn't actually alter the keyvalue, it just makes the engine think the value is different. Sooo...maybe the engine forward?
|
Things that plugins do don't go through the hook layer anymore - so you can't intercept them (maybe with some hacks you could); otherwise it would be too easy to get infinite recursion problems and such.
The first plugin would have to notify the second one. We don't have an observer pattern implementation IIRC so callfunc would be most likely your best bet. Of course, assuming that you are able to modify the first plugin. I hope I haven't misunderstood you :) edit: bail said: plugins can do CreateMultiForward() I imagine that that'd be better than callfunc. |
Thanks :)
I think I'll try callfunc then ;) |
| All times are GMT -4. The time now is 05:06. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.