AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Solved how to play a sound repeatedly? (https://forums.alliedmods.net/showthread.php?t=323756)

rrduna 04-27-2020 09:22

how to play a sound repeatedly?
 
the sound of the rain that I will call should be repeated as soon as it is over. i need to call client_cmd (0, "spk") at exactly this point in my code

PHP Code:

    // rain
    
if (g_weather_rain){
        if (
g_weather_rain == 0)
        return;
        
        if (
g_weather_rain == 1){
            
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_rain"));
            
            
// sound repeatedly here
        
}
    } 


alferd 04-27-2020 11:19

Re: how to play a sound repeatedly?
 
PHP Code:

public sss()
{
    
// rain
    
if (g_weather_rain){
        if (
g_weather_rain == 0)
        return;
        
        if (
g_weather_rain == 1){
            
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_rain"));
            
            
// sound repeatedly here
        
        
set_task(30.0"sss")
        }
    }  


Set the sound time to "set_task"

OciXCrom 04-27-2020 13:36

Re: how to play a sound repeatedly?
 
Code:
if (g_weather_rain){         if (g_weather_rain == 0)

What is the point of that? How can the value be 0 and non-0 at the same time?

rrduna 04-27-2020 21:09

Re: how to play a sound repeatedly?
 
alferd, thank you


All times are GMT -4. The time now is 00:33.

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