Author Topic: why is it only works 1 ?  (Read 1165 times)

[EG]~[S]aha~

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +1/-9
  • Liberty Unleashed!
    • View Profile
why is it only works 1 ?
« on: December 30, 2012, 02:02:20 pm »
g_pSound <- null;
function onClientDeath ( killer, weapon, bodypart, )
{
if ( !g_pSound )
       {
               g_pSound = FindSound( "death.mp3" );
               if ( g_pSound )
               {
                    g_pSound.Open();
                    g_pSound.Play();
                   
                   
               }
       }
 return 1;
}

Thijn

  • Tester
  • Sr. Member
  • ****
  • Posts: 531
  • Karma: +27/-16
    • View Profile
Re: why is it only works 1 ?
« Reply #1 on: December 30, 2012, 03:09:22 pm »
Try
Code: [Select]
g_pSound <- null;
function onClientDeath ( killer, weapon, bodypart, )
{
if ( !g_pSound )
       {
               g_pSound = FindSound( "death.mp3" );
               if ( g_pSound )
               {
                    g_pSound.Open();
                    g_pSound.Play();
                   
                   
               }
       }
       else
       {
           g_pSound.Play();
        }
 return 1;
}

[EG]~[S]aha~

  • Jr. Member
  • **
  • Posts: 54
  • Karma: +1/-9
  • Liberty Unleashed!
    • View Profile
Re: why is it only works 1 ?
« Reply #2 on: December 30, 2012, 03:19:29 pm »
Thank you very much :) Thijn

 

© Liberty Unleashed Team.