Raised This Month: $51 Target: $400
 12% 

Kill already playing sound?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MindeLT
Senior Member
Join Date: Dec 2010
Location: Lithuania
Old 10-13-2011 , 14:44   Kill already playing sound?
Reply With Quote #1

Is there is any way to kill already playing sound?
For exaple.

I'm editing anti-camp plugin, to play camper song every time a player camps. However, if player stops camping he will listen it to the end, to stop? So i need something to stop that music, once player stops camping.


PHP Code:
public Action:BeaconTimer(Handle:timerany:client)
{
    if(!
client || !IsClientInGame(client) || !IsClientConnected(client) || !IsPlayerAlive(client))
    {
        
ResetTimer(client);
        return 
Plugin_Handled;
    }

    
// Create a beam effect and another one after
    
if(GetConVarBool(g_CvarCamper))
    {
        
EmitSoundToClient(client"eurocss_garsai/public/camp/camper_camper.mp3"SOUND_FROM_PLAYERSNDCHAN_AUTOSNDLEVEL_NORMAL);
    }

    return 
Plugin_Handled;

MindeLT is offline
Send a message via Skype™ to MindeLT
McFlurry
Veteran Member
Join Date: Mar 2010
Location: RemoveEdict(0);
Old 10-13-2011 , 15:04   Re: Kill already playing sound?
Reply With Quote #2

Uh, StopSound(entity, channel, const String:name[])
__________________
McFlurry is offline
Send a message via Skype™ to McFlurry
MindeLT
Senior Member
Join Date: Dec 2010
Location: Lithuania
Old 10-14-2011 , 05:17   Re: Kill already playing sound?
Reply With Quote #3

Thx Flurry
MindeLT is offline
Send a message via Skype™ to MindeLT
MindeLT
Senior Member
Join Date: Dec 2010
Location: Lithuania
Old 10-14-2011 , 15:55   Re: Kill already playing sound?
Reply With Quote #4

Erm, got to other problem.

Created boolen value to check is sound is running. However, i get music mashup, one on one. Any suggestions thx?

PHP Code:
        //if(!zaidejas_campina)
        
if(!IsCamping(client))
        {
            
//zaidejas_campina = true;
            
EmitSoundToClient(client"eurocss_garsai/public/camp/camper_camper.mp3"SOUND_FROM_PLAYERSNDCHAN_AUTOSNDLEVEL_NORMALSND_NOFLAGSSNDVOL_NORMALSNDPITCH_NORMAL, -1NULL_VECTORNULL_VECTORtrue123.0);
        }
        else
        {
            
StopSound(clientSNDCHAN_AUTO"eurocss_garsai/public/camp/camper_camper.mp3");
        } 

Last edited by MindeLT; 10-14-2011 at 17:16.
MindeLT is offline
Send a message via Skype™ to MindeLT
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 02:05.


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