PDA

View Full Version : Voice stream problem



stoiczkow
28th January 2019, 16:41
Hey, could you help with it. Game is loading but with keys combination not working.



init()
{

game["menu_ballerina"] = "ballerina";


precacheMenu(game["menu_ballerina"]);
precacheHeadIcon("talkingicon");
}

ballerina(response)
{
if(!isdefined(self.pers["team"]) || self.pers["team"] == "spectator" || isdefined(self.spamdelay))
return;

self.spamdelay = true;
saytext = "";
soundalias = "";

if(self.pers["team"] == "allies")
{
switch(response)
{
case "1":
soundalias = "ammo";
saytext = "Need ammo!";
break;

case "2":
soundalias = "medic";
saytext = "Need medic!";
break;


}
}


self doQuickMessage(soundalias, saytext);

wait 2;
self.spamdelay = undefined;

}

doQuickMessage(soundalias, saytext)
{
if(self.sessionstate != "playing")
return;

if(isdefined(level.QuickMessageToAll) && level.QuickMessageToAll)
{
self.headiconteam = "none";
self.headicon = "talkingicon";

self playSound(soundalias);
self sayAll(saytext);
}
else
{
if(self.sessionteam == "allies")
self.headiconteam = "allies";
else if(self.sessionteam == "axis")
self.headiconteam = "axis";

self.headicon = "talkingicon";

self playSound(soundalias);
self sayTeam(saytext);
self pingPlayer();
}
}



...for
ammo,,sanyo_sounds/ammo.mp3,1,1,,,,7,3000,voice,streamed,,,,all_mp
ammo,2,sanyo_sounds/ammo2.mp3,1,1,,,,7,3000,voice,streamed,,,,all_mp
ammo,3,sanyo_sounds/ammo3.mp3,1,1,,,,7,3000,voice,streamed,,,,all_mp
ammo,4,sanyo_sounds/ammo4.mp3,1,1,,,,7,3000,voice,streamed,,,,all_mp
ammo,5,sanyo_sounds/ammo5.mp3,1,1,,,,7,3000,voice,streamed,,,,all_mp

medic,,sanyo_sounds/medic.mp3,1,1,,,,7,3000,voice,streamed,,,,all_mp
medic,2,sanyo_sounds/medic2.mp3,1,1,,,,7,3000,voice,streamed,,,,all_mp
medic,3,sanyo_sounds/medic3.mp3,1,1,,,,7,3000,voice,streamed,,,,all_mp
medic,4,sanyo_sounds/medic4.mp3,1,1,,,,7,3000,voice,streamed,,,,all_mp
medic,5,sanyo_sounds/medic5.mp3,1,1,,,,7,3000,voice,streamed,,,,all_mp

IzNoGoD
28th January 2019, 17:58
Check _menus.gsc

stoiczkow
28th January 2019, 19:02
game["menu_ballerina"] = "ballerina";
precacheMenu(game["menu_ballerina"]);
i added condition

else if(menu == game["menu_ballerina"])
{
switch(response)
{
case "1":
soundalias = "ammo";
saytext = "Need ammo!";
break;

case "2":
soundalias = "medic";
saytext = "Need medic!";
break;



default:
break;
}
}

game open, no reaction

IzNoGoD
28th January 2019, 19:20
No, your menuresponse is caught in _menus.gsc. Look how quickresponses are done there.

stoiczkow
28th January 2019, 19:44
Done!