Hello, i need to make small plugin with table where i can start music and stop music. Start Music works fine, but i cant stop music and if i start another music, i have here StopSound and then emit... for next song, but song didnt stop and play another, then i hear two songs at a time. Can someone help me please? Here is a example for a code, i test SNDCHAN_AUTO too. Thanks
Code:
public Action:HudbaTabulka(client, args){
new Handle:hudba = CreateMenu(HudbaMenu);
SetMenuTitle(hudba, "[SM] URNA Hudba Menu DJ");
AddMenuItem(hudba, "mathew", "Matthew Strider");
AddMenuItem(hudba, "poltergeist", "Poltergeist");
SetMenuPagination(hudba, 7);
SetMenuExitButton(hudba, true);
DisplayMenu(hudba, client, MENU_TIME_FOREVER);
}
public HudbaMenu(Handle:hudba, MenuAction:action, client, Position){
new String:item[32];
if(action == MenuAction_Select){
GetMenuItem(hudba, Position, item, sizeof(item));
if(StrEqual(item, "mathew")){
for(new i = 1; i <= GetMaxClients(); i++){
if(IsClientInGame(i)){
StopSound(i, 8, "urna/matthewstrider.mp3");
StopSound(i, 8, "urna/poltergeist.mp3");
}
}
EmitSoundToAll("urna/matthewstrider.mp3", SOUND_FROM_WORLD, 8, SNDLEVEL_AIRCRAFT);
}
else if(StrEqual(item, "poltergeist")){
for(new i = 1; i <= GetMaxClients(); i++){
if(IsClientInGame(i)){
StopSound(i, 8, "urna/matthewstrider.mp3");
StopSound(i, 8, "urna/poltergeist.mp3");
}
}
EmitSoundToAll("urna/poltergeist.mp3", SOUND_FROM_WORLD, 8, SNDLEVEL_AIRCRAFT);
}
}
}