Liberty Unleashed

Scripting => Script Help => Topic started by: [EG]~[S]aha~ on December 30, 2012, 01:02:20 pm

Title: why is it only works 1 ?
Post by: [EG]~[S]aha~ on December 30, 2012, 01: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;
}
Title: Re: why is it only works 1 ?
Post by: Thijn on December 30, 2012, 02: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;
}
Title: Re: why is it only works 1 ?
Post by: [EG]~[S]aha~ on December 30, 2012, 02:19:29 pm
Thank you very much :) Thijn