FM_KeyValue
I registered the forward FM_KeyValue but it actually never got called.
I want the following function to be called when some KeyValue on an entity, to be more precisely, a client, has changed. Code:
never being called. Note that I registered the forward in plugin_init, because thats where to register cvars too which this function shall know about. |
Re: FM_KeyValue
I believe you have to register that forward in public plugin_precache().
|
Re: FM_KeyValue
Why that? This function is called frequently. Everytime an entities keyvalue changes!
Monsters hp. Players health, armor, angles, velocity, and that displayname. Why should this requires to be registered that second earlier?? |
Re: FM_KeyValue
I don't know FM_KeyValue that well but all I remember when I saw other people used it. It was registered in precache and they were trying to modify the keyvalue of those entity to there liking.
I only saw FM_KeyValue forward used that way although I can be totally wrong on this though. Since I do not deal with entity stuff that much. |
Re: FM_KeyValue
I have tried that but it still is not being called.
now i tried something completely different. The following function is being called when the player spawns: Code:
|
Re: FM_KeyValue
AFAIK, pfnKeyValue is for non-player entities only.
Furthermore you shouldn't return string function result in this case bause this function returns nothing: Quote:
Quote:
I think you are looking for pfnSetClientKeyValue. |
Re: FM_KeyValue
What is pfnSetClientKeyValue? Can't find it in any .inc, doc or functions database.
|
Re: FM_KeyValue
pfnSetClientKeyValue is HL engine function.
To hook it you have to use register_froward(FM_SetClientKeyValue, ...) And to call it you have to use engfunc(EngFunc_SetClientKeyValue, ...) |
Re: FM_KeyValue
Funny, I tried exactly that one before and it also never was called after plugin_init.
I needed something that is called everytime a keyvalue of a player changes. In instance every time a player takes damage such event should be called, because his health keyvalue has changed. But whatsoever I just discovered that svencoop never touches displayname. it gets the playersname and puts that in the hudmessage. Only if displayname is added it is looking for it. so now I do the job when the player spawns and I want to do it when he changes name i use client_infochanged but with a set_task on 0.2 seconds as it is a forward. Anyways I'd still like to have a Forward I asked for. |
Re: FM_KeyValue
Well there still is nothing happening. the displayname is being changed, but is not being showed really.
it is like in entmod - when u change an entities keyvalues u have to respawn it. Any idea on how to get around that when handling with a player? |
| All times are GMT -4. The time now is 06:42. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.