Raised This Month: $246 Target: $400
 61% 

Solved how to play a sound repeatedly?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rrduna
Member
Join Date: Nov 2010
Location: Brazil
Old 04-27-2020 , 09:22   how to play a sound repeatedly?
Reply With Quote #1

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
        
}
    } 

Last edited by rrduna; 04-27-2020 at 21:10. Reason: Solved
rrduna is offline
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 04-27-2020 , 11:19   Re: how to play a sound repeatedly?
Reply With Quote #2

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"

Last edited by alferd; 04-27-2020 at 11:22.
alferd is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-27-2020 , 13:36   Re: how to play a sound repeatedly?
Reply With Quote #3

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?
__________________


Dear admins. If somehow you managed to read this, plz fix.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
rrduna
Member
Join Date: Nov 2010
Location: Brazil
Old 04-27-2020 , 21:09   Re: how to play a sound repeatedly?
Reply With Quote #4

alferd, thank you
rrduna is offline
Reply


Thread Tools
Display Modes

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 16:30.


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