Raised This Month: $ Target: $400
 0% 

Help with plugin sound


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
blackwave
Junior Member
Join Date: Jan 2011
Old 01-09-2011 , 12:24   Help with plugin sound
Reply With Quote #1

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 is offline
 



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 02:07.


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