cs_set_user_model — place for call
Hello.
For example, I have my custom SAS Player model ("sas_super.mdl"). I want use this model on my server as fully replace a default SAS model (for every player, who selects SAS for CT). Okay, and where I should call cs_set_user_model() function? In many of plugins, this function called after player spawn, but, it's correct? Thanks! |
Re: cs_set_user_model — place for call
Quote:
I know how to hook player Spawn and I know how to set player model. I am looking for place better than player spawn where I should call cs_set_model function. |
Re: cs_set_user_model — place for call
This is not what he wants.
To catch when sas model is applied, hook FM_SetClientKeyValue, filter when key is "model" and when value is "sas", then, check actual user model (get_user_info(id, "model", szModel, charsmax(szModel)), in case you would already have applied the model. In both cases you supercede the function, and if actual player model is not your custom one, send set_user_info(index, "model", CUSTOM_SAS) on it. Don't use cs_set_user_model it is buggy. |
Re: cs_set_user_model — place for call
Patching strings in memory more efficient https://forums.alliedmods.net/showthread.php?t=117930
|
Re: cs_set_user_model — place for call
Quote:
|
Re: cs_set_user_model — place for call
ConnorMcLeod, thanks you very much! You're master :D.
I write (done) working code (replase "sas" on "test" model), hope it is okay: PHP Code:
|
Re: cs_set_user_model — place for call
supercede should be for the whole "sas" matching block.
|
Re: cs_set_user_model — place for call
I have strange problem with models set and userinfo O_O. My code:
PHP Code:
But, I want add disable feature. If ADMIN does not want to use custom (_sp) model, then he write: Code:
setinfo "sp_model" "0"If admin connect to server without "sp_model" setinfo, join in team, got your custom _sp model (it's okay). And if he alive and he write "sp_model" "0" setinfo right now, then model of admin be changed to default selected (realtime)! Why? How to fix it? |
Re: cs_set_user_model — place for call
When a player writes setinfo FIELD VALUE in console, that info is set on engine client, and if the field is new, or if the value has changed, ClientInfoChanged is sent to DLL (engine calls cs function).
In ClientInfoChanged code, cs checks player model and tries to set it back to default values is model doesn't match default values. What you could do is on client_infochanged, check for sp_model info, and don't use that value untill new round / next spawn |
Re: cs_set_user_model — place for call
ConnorMcLeod, thanks you very much.
|
| All times are GMT -4. The time now is 23:20. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.