Raised This Month: $ Target: $400
 0% 

Play sound @ event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rdewit
New Member
Join Date: Oct 2009
Old 10-25-2009 , 04:16   Play sound @ event
Reply With Quote #1

Game: CS:S
Platform: Linux


Dear programmers,

I use a mod called "KnifeKing" Now I would like to play a sound when someone is the new knifeking. I added the following line but does not work.

// play sound
EmitSoundToAll("/cstrike/sound/buttons/weapon_cant_buy.wav");

Can someone pleaaaase help me?



p.s. I also installed: eventscript, mani admin.
rdewit is offline
Flynn
Senior Member
Join Date: Sep 2009
Old 10-25-2009 , 04:23   Re: Play sound @ event
Reply With Quote #2

First post since a long time for me (been busy at Uni).

Firstly, drop the formality, everyone is friendly here and we aren't going to reprimand you for failure to match some sort of corporate standard (unless I have been really out of the loop).

Secondly, http://docs.sourcemod.net/api/ is your friend.

EmitSoundToAll by specification (under documentation, above supplied) is...
Quote:
relative to the "sounds" folder
So you want...
Code:
EmitSoundToAll("buttons/weapon_cant_buy.wav");
Eventscript and mani admin will most likely conflict, although I cannot say this for certain.
Flynn is offline
Send a message via MSN to Flynn Send a message via Skype™ to Flynn
ShadowMoses
Junior Member
Join Date: May 2007
Location: Ventura, CA
Old 10-26-2009 , 22:57   Re: Play sound @ event
Reply With Quote #3

Add this after the VERSION #define
Code:
#define SOUND_NEWKING "buttons/weapon_cant_buy.wav"
Add this after OnMapStart(){}
Code:
public OnConfigsExecuted()
{
    PrecacheSound(SOUND_NEWKING, true);
}
Replace this:
Code:
if (g_KnifeKing != k_Client)  //New Knifeking
{
     g_KnifeKing = k_Client;  //store knifeking client in the global variable
     g_CurrentRounds = 0;     //Reset Current rounds for knifeking
}
With this:
Code:
if (g_KnifeKing != k_Client)  //New Knifeking
{
     EmitSoundToAll(SOUND_NEWKING);
     g_KnifeKing = k_Client;  //store knifeking client in the global variable
     g_CurrentRounds = 0;     //Reset Current rounds for knifeking
}
ShadowMoses is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 10-28-2009 , 02:43   Re: Play sound @ event
Reply With Quote #4

I don't think ES and Mani conflict. I've seen plenty of server hosts use both just fine.
__________________
Greyscale 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 20:51.


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