AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Extra Precache Function (https://forums.alliedmods.net/showthread.php?t=113476)

KadiR 12-27-2009 07:24

Extra Precache Function
 
In this plugin here:

http://forums.alliedmods.net/showthread.php?p=34730

There is this Precache Function:

PHP Code:

    if (file_exists("sound/fireworks/rocket1.wav")) {
        
precache_sound("fireworks/rocket1.wav")
        
has_rocket 1
    
} else {
        
precache_sound("weapons/rocket1.wav")
        
has_rocket 0
    
}

    if (
file_exists("sound/fireworks/weapondrop1.wav")) {
        
precache_sound("fireworks/weapondrop1.wav")
        
has_drop 1
    
} else {
        
precache_sound("items/weapondrop1.wav")
        
has_drop 0
    


So, the sounds are the default files, but I can also use the new ones in the fireworks folder am I right?
Can I remove the special sound files? And how would the code look like then?

ConnorMcLeod 12-27-2009 15:35

Re: Extra Precache Function
 
Just don't add the sound file on the server ftp, default sound will be used then.

KadiR 12-27-2009 15:42

Re: Extra Precache Function
 
Quote:

Originally Posted by ConnorMcLeod (Post 1033059)
Just don't add the sound file on the server ftp, default sound will be used then.

Ok, but I wouldn't become any errors, would I? Cause there are already default files how I said.

Arkshine 12-27-2009 16:11

Re: Extra Precache Function
 
No it would not.


All times are GMT -4. The time now is 04:05.

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