Raised This Month: $ Target: $400
 0% 

[L4D2] Managment AmbientSound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
flud
Senior Member
Join Date: Jun 2009
Location: Latvija
Old 05-03-2010 , 20:24   [L4D2] Managment AmbientSound
Reply With Quote #1

Hello again i need you help

I'm write simple code to play sound by EmitAmbientSound command
Everything work fine but i need two important function.

First it's stop sound, don't find answer how to stop ambient sound.
Last it's custom path to sound file instead of using define, here example
I write in chat !asound blabla/cool.wav it's preloaded and play.

It's Possible ?

here the code
PHP Code:
#include <sourcemod>
#include <sdktools>

#pragma semicolon 1
#define PLUGIN_VERSION "1.0"
#define MUSIC "music/flu/concert/midnightride.wav"

public Plugin:myinfo 
{
    
name "spawn sound",
    
author "FluD",
    
description "temp",
    
version PLUGIN_VERSION,
    
url "www.google.com"
}
public 
OnPluginStart()
{
    
//cmd 
    
RegAdminCmd("sm_asound"Activate_soundADMFLAG_SLAY,"Spawns a sound");
    
RegAdminCmd("sm_ssound"Stop_soundADMFLAG_SLAY,"Stop a sound");
    
//plugin version 
    
CreateConVar("asound_version"PLUGIN_VERSION"Asound_Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
}
public 
Action:Activate_sound(clientargs)
{
    
PrecacheSound(MUSIC);
    new 
Float:pos[3];
    
GetClientAbsOrigin(clientpos);
    
EmitAmbientSound(MUSICposclientSNDLEVEL_RAIDSIREN);
    
    return 
Plugin_Continue;
}
public 
Action:Stop_sound(clientargs)
{
    
StopSound(client0MUSIC);
    return 
Plugin_Continue;

p.s
don't look at thread name mistakes
forged edit
__________________
Beware of a terrible language

Last edited by flud; 05-03-2010 at 20:26.
flud is offline
Send a message via Skype™ to flud
FaTony
Veteran Member
Join Date: Aug 2008
Old 05-04-2010 , 18:41   Re: [L4D2] Managment AmbientSound
Reply With Quote #2

PHP Code:
decl String:soundstring[256];
GetCmdArg(1soundstring);
PrecacheSound(soundstring); 
new 
Float:pos[3]; 
GetClientAbsOrigin(clientpos); 
EmitAmbientSound(soundstringposclientSNDLEVEL_RAIDSIREN); 
FaTony 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 09:39.


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