does_function_exist(is_file_precached()) == 0
my server happens to precache many files, and I want to cut back the number of precaches per connect:
you have to precache a model before you use it but is there any way to do something like this: 1st Scenario Code:
or can I do something like this I hear file_exists only checks the server is this true? 2nd Scenario Code:
3rd Scenario Code:
^^ I doubt there is even a function for scenario 3, but that is a great function to have, I think we should get that function if it doesnt exist. |
Your plugins precache the files. Comment out the plugins to have less stuff to precache.
|
You could easily do all this.
When you go to precache something, check if its availible on the server, then precache it and set a global bool to true if it can be precached, or to false if it cant. Then you can just check the bool if its precached or not, and make changes accordingly. No need for a whole new function. |
I think you're missing the point, basically I want to
entity_set_model(victim, "models/predator.mdl") only if the CLIENT has the file, i think part of the problem is that precache_model() both downloads file for client and loades it into memory on server/client. it would be nice to be able to precache just load to memory if the file exists, and have a separate function to handling all downloading of files. |
I totally misinterpreted.
No there's no such thing. But doing it like TZ suggested is of course possible. But serverside you cannot see what files a client has. |
If Small had associative arrays, an is_file_precached thing would be easily do-able, just catch PrecacheModel, PrecacheSound, and PrecacheGeneric with FakeMeta.
Yes it is true that file_exists is only for the server. |
You could essentially mimic Associative arrays using Parallel arrays..
|
Quote:
|
If you want to see if a function exists... I'd suggest you'd..
:rtfm: |
Not helpful vex.
Also, precaching something FORCES both the client and the server to have it, thus eliminating the problem. Or you could use force_unmodified to make sure they have the same file. But other then that, you cannot limit functionality depending on whether or not they have a file. |
| All times are GMT -4. The time now is 13:58. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.