Raised This Month: $32 Target: $400
 8% 

[CSGO] Emit sound with volume level ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Elitcky
AlliedModders Donor
Join Date: Jun 2016
Location: Antofagasta, Chile
Old 11-20-2021 , 01:32   [CSGO] Emit sound with volume level ?
Reply With Quote #1

Hi there.

I have this countdown thing, "iTimeDelta" which i want to play it with the music in the folder, so i have 10 to 0 in mp3 sound, and the countdown is from 10 to 0, so... which emitsound should i use for make it happen ?

Im actually using just ClientCommand, but i can't change the volume level, and the players are complaining because its too loud

PHP Code:
char szSound[16];
    
int iCountdownTimeFloor RoundToFloor(g_fCountdownTime);

    
g_iCountdownCount++;
    if(
g_iCountdownCount g_fCountdownTime) {
        for(
int iClient 1iClient MaxClientsiClient++) {
            if(
IsClientInGame(iClient)) {
                
int iTimeDelta iCountdownTimeFloor g_iCountdownCount;
                
IntToString(iTimeDeltaszSound15);
                
ClientCommand(iClient"play */contador/%s.mp3"szSound);
                
PrintCenterText(iClient"\n  %t""Start Countdown"iTimeDelta, (iTimeDelta == 1) ? "" "s");

                
int team GetClientTeam(iClient);
                if(!
IsPlayerAlive(iClient) && (team == CS_TEAM_CT || team == CS_TEAM_T))
                {
                    
CS_RespawnPlayer(iClient);
                }
            }
        }
        return 
Plugin_Continue;
    } 
If u can give me like another point of view to work this out please, thanks !
__________________
Elitcky is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 11-21-2021 , 19:57   Re: [CSGO] Emit sound with volume level ?
Reply With Quote #2

https://sm.alliedmods.net/new-api/sd...EmitSoundToAll

PHP Code:
    PrecacheSound("player/death1.wav");
    
EmitSoundToAll("player/death1.wav"SOUND_FROM_PLAYER, .level SNDLEVEL_CONVO, .volume 0.5); 
*edit
https://sm.alliedmods.net/new-api/sd...tSoundToClient

PHP Code:
    PrecacheSound("player/death1.wav");
    
EmitSoundToClient(client"player/death1.wav"SOUND_FROM_PLAYER, .level SNDLEVEL_CONVO, .volume 0.5); 
__________________
Do not Private Message @me

Last edited by Bacardi; 11-21-2021 at 20:01.
Bacardi is offline
Reply



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 00:36.


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