Quote:
|
Originally Posted by [ --<-@
Black Rose]would this really work?
Code:
public plugin_precache() {
if (file_exists("sound/misc/woohoo.wav"))
precache_sound("misc/woohoo.wav")
}
the file_exist is totally unecessary and if it wold be there, there would be an ! in front of it
|
Putting a '!' in front of the if statement would precache the sound if it DIDN'T exist. Which would then make it truely unecssary.
Why? It prevents the server from crashing if it does not have it. But, you should make it print a warning message if its not precached to let the server know so they can add it.
Just in case somebody wants to argue
Quote:
|
file_exists - Checks if a file exists (returns 1 on success, 0 on failure).
|
__________________