AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with plugin sound (https://forums.alliedmods.net/showthread.php?t=147455)

blackwave 01-09-2011 12:24

Help with plugin sound
 
Hello. I'm new in this forum. I need help with my sound plugin, which plays a random sound on TR/CT winning ( depending which one ). I extracted selected parts from some of my favorite musics, and saved as .wav. The plugin will play songs.. but the problem is that all of these songs doesn't stops... Just the file:

rollingstar.wav

I dont know why. Hope you can help me. My code:
Code:

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <csx>

#define PLUGIN "Death"
#define VERSION "2.0"
#define AUTHOR "felipe"
#pragma tabsize 0
new sounds[][] =
{
    "misc/rollingstar.wav",
        "misc/clubcanthandle.wav",
        "misc/control.wav",
        "misc/loveisgone.wav",
        "misc/gottaremix.wav",
        "misc/tiesto.wav",
        "misc/girl.wav",
        "misc/partyanimal.wav",
        "misc/gettinover.wav",
        "misc/rollerhead.wav",
        "misc/owlcity.wav"
};
public plugin_precache()
{
  for ( new i; i == sizeof sounds; i++ )
  {
      precache_sound( sounds[ i ] );
  }
  return PLUGIN_CONTINUE
}
public plugin_init()
{
  register_plugin("Die Music","1.0","Punani")
  register_event("SendAudio", "t_win", "a", "2&%!MRAD_terwin")
  register_event("SendAudio", "ct_win", "a", "2&%!MRAD_ctwin") 
  return PLUGIN_CONTINUE
   
}
public t_win()
{
  client_cmd(0,"stopsound")
  play_sound("misc/rollingstar")
  return PLUGIN_HANDLED
 
}

public ct_win()
{
  client_cmd(0,"stopsound")
  play_sound("misc/owlcity")
  return PLUGIN_HANDLED
}

 

public client_death(killer, victim, wpnindex, hitplace, TK)
{
       
    static killerName[32], victimName[32], message[128];
    new selfkill = (killer == victim) ? 1 : 0
    if(selfkill || killer == victim || killer == 0 || wpnindex == CSW_HEGRENADE &&  selfkill == 0)
    {
              //client_cmd(0,"mp3 play sound/misc/end1.mp3")
              play_sound("misc/burico")
              get_user_name(victim, victimName, 31)
              formatex(message, sizeof(message),"%s se matou ! ! !",victimName);
              client_print(0, print_center, message);
       
        }
    if(wpnindex == CSW_KNIFE)
    {
        play_sound("misc/cadechinelo")
        }
   
    return PLUGIN_CONTINUE
}
public eEndRound()
{
 
  client_cmd(0,"stopsound")
  return PLUGIN_CONTINUE
}




public play_sound(sound[])
{
        new players[32], pnum
        get_players(players, pnum, "c")
        new i
       
        for (i = 0; i < pnum; i++)
        {
                if (is_user_connecting(players[i]))
                        continue
               
                client_cmd(players[i], "spk %s", sound)
        }
}

This one is moddified, since I was tryin to check if any other songs wouldn't stop

blackwave 01-09-2011 19:05

Re: Help with plugin sound
 
bump .

blackwave 01-10-2011 14:30

Re: Help with plugin sound
 
bump... over 2 days

lucas_7_94 01-10-2011 14:32

Re: Help with plugin sound
 
should wait 2 weeks to bumb

Len 01-11-2011 11:54

Re: Help with plugin sound
 
uve got to wait 15 days after a day or two you thread will be on the next page an most people don't bother checking them, so then you've got to pointlessly wait a further 13 days for a answer im afraid :mrgreen: it's the rules


All times are GMT -4. The time now is 02:07.

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