menu hotkeys, spect fix, recoiltest, voicecom

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1638 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2008-02-11 14:18:54 +00:00
parent 033a150775
commit 3fc9b1155f
18 changed files with 216 additions and 31 deletions
+27
View File
@@ -488,3 +488,30 @@ void playsoundc(int n)
addmsg(SV_SOUND, "i", n);
playsound(n);
}
void voicecom(char *sound, char *text)
{
if(!sound || !sound[0]) return;
static int last = 0;
if(!last || lastmillis-last > 2000)
{
s_sprintfd(soundpath)("voicecom/%s", sound);
int s = findsound(soundpath, 0, gamesounds);
if(s < 0 || s < S_AFFIRMATIVE || s > S_NICESHOT) return;
playsound(s);
if(s == S_NICESHOT) // public
{
addmsg(SV_VOICECOM, "ri", s);
toserver(text);
}
else // team
{
addmsg(SV_VOICECOMTEAM, "ri", s);
s_sprintfd(teamtext)("%c%s", '%', text);
toserver(teamtext);
}
last = lastmillis;
}
}
COMMAND(voicecom, ARG_2STR);