Raised This Month: $ Target: $400
 0% 

does_function_exist(is_file_precached()) == 0


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
genesis
Senior Member
Join Date: Oct 2004
Location: CALIFORNIA, USA
Old 02-24-2005 , 03:56   does_function_exist(is_file_precached()) == 0
Reply With Quote #1

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:
on error resume next entity_set_model(victim, "models/predator.mdl") next

or can I do something like this
I hear file_exists only checks the server is this true?
2nd Scenario
Code:
if file_exists("models/predator.mdl") {               entity_set_model(victim, "models/predator.mdl") }

3rd Scenario

Code:
is_file_precached("models/predator.mdl")         entity_set_model(victim, "models/predator.mdl")

^^ 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.
__________________
CS 1.6 cali.radclan.net:27015
I have a feeling we're not in cs anymore.
I take pride that all my AMXX plugins were writen in notepad.
genesis is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 02-24-2005 , 07:42  
Reply With Quote #2

Your plugins precache the files. Comment out the plugins to have less stuff to precache.
Johnny got his gun is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 02-24-2005 , 12:04  
Reply With Quote #3

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.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
genesis
Senior Member
Join Date: Oct 2004
Location: CALIFORNIA, USA
Old 02-24-2005 , 14:17  
Reply With Quote #4

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.
__________________
CS 1.6 cali.radclan.net:27015
I have a feeling we're not in cs anymore.
I take pride that all my AMXX plugins were writen in notepad.
genesis is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 02-24-2005 , 14:43  
Reply With Quote #5

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.
Johnny got his gun is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-24-2005 , 15:09  
Reply With Quote #6

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.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 02-24-2005 , 18:12  
Reply With Quote #7

You could essentially mimic Associative arrays using Parallel arrays..
xeroblood is offline
Send a message via MSN to xeroblood
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 02-24-2005 , 19:03  
Reply With Quote #8

Quote:
Originally Posted by xeroblood
You could essentially mimic Associative arrays using Parallel arrays..
please dont confuse the noobs
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-24-2005 , 19:26  
Reply With Quote #9

If you want to see if a function exists... I'd suggest you'd..
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 02-24-2005 , 19:44  
Reply With Quote #10

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.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode