View Single Post
chuttenjr
Member
Join Date: Sep 2018
Location: Saipan
Old 09-24-2018 , 11:02   Re: Make rain sound to loop on RainySnowy (Enables CS weather) v2.0y by OneEyed & tea
Reply With Quote #8

Added code,compiled ok but its not working.

code now is set like this:

PHP Code:
GetSomeoneUnworthy() {
    new 
cntidtotal[33];
    for(
id=1;id<g_maxplayers;id++)
        if(
is_user_alive(id))
            if(
is_user_outside(id)) 
            {
                
total[cnt++] = id;    
                
                if(!
g_soundstate[id]) {
                    
g_soundstate[id] = 1;
                    
client_cmd(id"speak ambience/rain.wav");
                }    
            }
            else if(
g_soundstate[id]) 
            {
                
g_soundstate[id] = 0;
                
client_cmd(id"speak ambience/rainroof.wav")
            }
    
    if(
cnt)
        return 
total[random_num(0, (cnt-1))];
    return 
0;

}
public 
ambience_loop()  

 
    
set_task(50.0"ambience_loop"// Lasts 50s then loop after 50s

    //Go through all players
    
new players[32], iNum
    get_players
(playersiNum)

    for(new 
ii<iNum;i++)
    {
         
client_cmd(i"speak ambience/rain.wav"
         
client_cmd(i"speak ambience/rainroof.wav"
    }

shouldnt ambience loop new players be "33" like new cnt in "Get Someone Unworthy"??

Thanks for all your help

Eduardo

Last edited by chuttenjr; 09-24-2018 at 11:09. Reason: sintax error
chuttenjr is offline