Make plugin_prechase called after plugin_cfg
i want maje plugin_prechase function be called after plugin_cfg if ther is any ideas?
|
Re: Make plugin_prechase called after plugin_cfg
i dont think so you will able to change the order of execution
|
Re: Make plugin_prechase called after plugin_cfg
as i remember some words from a devoloper amxx he said to me every thing is possible in pawn :D
|
Re: Make plugin_prechase called after plugin_cfg
Whats the point of doing such a stupid thing?
|
Re: Make plugin_prechase called after plugin_cfg
better to save data to file before map changes and on restart server try to precache
|
Re: Make plugin_prechase called after plugin_cfg
Quote:
Stop using bad words in your .... Post |
Re: Make plugin_prechase called after plugin_cfg
Quote:
because i want make models with cvars but if i changed model from cvar and restarted server it will not read the models to prechase them but it will read the default from from function plugin_prechase then will be called plugin_cfg whitch has the cvar model |
Re: Make plugin_prechase called after plugin_cfg
just create the cvar in plugin_precache()... I think it gets called twice. So before creating a cvar check if it has already been made
|
Re: Make plugin_prechase called after plugin_cfg
I already told you it's not possible. And changing the sequence in which events are called is close to science fiction.
|
Re: Make plugin_prechase called after plugin_cfg
Quote:
|
Re: Make plugin_prechase called after plugin_cfg
Quote:
|
Re: Make plugin_prechase called after plugin_cfg
By using a time travel machine.
|
Re: Make plugin_prechase called after plugin_cfg
I don`t really see a point in this. lets say you figured a way to precache a file from cvar(i suggested you a method). And the admin changes cvar to other model. then gg. server crashes. because the model is not going to be redownloaded. just forget it man
|
Re: Make plugin_prechase called after plugin_cfg
It's very simple.... Registre the cvars in plugin_precache, not in plugin_cfg....
|
Re: Make plugin_prechase called after plugin_cfg
Quote:
|
Re: Make plugin_prechase called after plugin_cfg
Quote:
|
Re: Make plugin_prechase called after plugin_cfg
Quote:
|
Re: Make plugin_prechase called after plugin_cfg
Quote:
|
Re: Make plugin_prechase called after plugin_cfg
Quote:
|
Re: Make plugin_prechase called after plugin_cfg
Quote:
To authour: Keep calm and forget! You can't force plugin_cfg to be called before plugin_precache!!?! |
Re: Make plugin_prechase called after plugin_cfg
Quote:
|
Re: Make plugin_prechase called after plugin_cfg
Quote:
|
Re: Make plugin_prechase called after plugin_cfg
nobody said that you can't use a config file
people are saying you can not use a CVAR there is nothing stopping you from creating your own config file format, reading it manually at precache with fopen and parsing it for your models, like many other plugins are doing, but it is impossible to use a cvar for this (it will work, but your cvar will always have default value, since it's being set after you check it, so then what's the point?) |
Re: Make plugin_prechase called after plugin_cfg
Quote:
The default value is not always enforced. I can be wrong tho, and I'm too lazy to check. |
Re: Make plugin_prechase called after plugin_cfg
Quote:
I believe that's how other plugins do it |
Re: Make plugin_prechase called after plugin_cfg
Quote:
|
Re: Make plugin_prechase called after plugin_cfg
I guess you could do
Code:
server_cmd("exec path/to/file.cfg"); Also it's a misconception that config files are executed at plugin_cfg. I don't know about older versions of AMXX, but currently plugin_cfg gets called once all plugins get initialized (had plugin_init called for them). It's badly named. |
Re: Make plugin_prechase called after plugin_cfg
You can still precache in plugin_init/cfg() with EngFunc_PrecacheModel/Sound/Generic.
|
Re: Make plugin_prechase called after plugin_cfg
But the cvars will still be useless since changing them will be impossible.
|
Re: Make plugin_prechase called after plugin_cfg
I don't think the game cares when you register or change cvars or execute config files. I guess I'll test it.
EDIT: Tested, works. If I change the cvar in the file and change the map, I retrieve the new value. PHP Code:
|
Re: Make plugin_prechase called after plugin_cfg
I meant changing them via console during gameplay.
|
Re: Make plugin_prechase called after plugin_cfg
okay, so the simplest solution is:
- create cvars to store model paths - cache those cvar values in global variables once before precaching - forget about cvar, use cached values to precache, and then later on apply the model to players or objects the cvar cache will make sure that even if the cvar is changed during the game, the old precached models will be used until precaching occurs again then it's as simple as mentioning in the plugin docs that restarts are necessary to apply changes for those cvars sorry for overcomplicating it with the custom files, while they are also a viable solution(and they avoid storing duplicate values in memory), this is simpler, and therefore better in this context (of assisting in scripting help) Quote:
Code:
This is absolutely necessary if planning to use cfg files other than server.cfg to set the value of such cvars in operations that happen as early as precache / init |
Re: Make plugin_prechase called after plugin_cfg
Quote:
|
Re: Make plugin_prechase called after plugin_cfg
i tested KliPPy way and it works =)
|
Re: Make plugin_prechase called after plugin_cfg
Quote:
|
Re: Make plugin_prechase called after plugin_cfg
The admin can dare change the model in the middle of the game, what's up? Will it advance what you alter the order of execution? If you load the path from a file, the admin will be required to restart the server, so to speak.
|
Re: Make plugin_prechase called after plugin_cfg
Quote:
|
Re: Make plugin_prechase called after plugin_cfg
Quote:
|
Re: Make plugin_prechase called after plugin_cfg
Quote:
First im maked a plugin Admin models but ther is to mutch admin models, so i added new feature is changing model by cvar but ther is bug cvars change only from sma not from amxx.cfg or something that i wanted to make plugin_prechase call after plugin_cfg not before it so i now stile searching a way if Klippy way by exec the cfg fille of admins model is the only way so making it by ini fille would be more better to add it intro my post https://forums.alliedmods.net/showthread.php?t=302473 |
Re: Make plugin_prechase called after plugin_cfg
or precache all needed models and change them by cvar at any time you wish.
|
All times are GMT -4. The time now is 15:45. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.