Raised This Month: $51 Target: $400
 12% 

(script.help) play music only once


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
algoasi
Member
Join Date: Nov 2008
Location: Pluton
Old 04-14-2009 , 02:31   (script.help) play music only once
Reply With Quote #1

I have this script. but I have a problem.

playing infinitely

I just want to be heard only once

not permanently


Attached Files
File Type: sma Get Plugin or Get Source (0007sound_beta.sma - 668 views - 957 Bytes)
algoasi is offline
Send a message via MSN to algoasi
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-14-2009 , 04:02   Re: (script.help) play music only once
Reply With Quote #2

Code:
client_cmd(player,"mp3 loop sound/misc/0007.mp3")
instead of "loop" place "play".
__________________
Hunter-Digital is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-14-2009 , 06:29   Re: (script.help) play music only once
Reply With Quote #3

@algoasi: you shoud use precache_generic for mp3. What do you want to do exactly ?

Something this is better, but can be coded in a more appropriate way depending your need :

PHP Code:
#include <amxmodx>
#include <cstrike>

const MAX_CLIENTS 32;
new 
bool:playingMAX_CLIENTS ];

new const 
gSound[] = "sound/misc/0007.mp3";

public 
plugin_precache() 
{
    
precache_genericgSound );
}

public 
plugin_init()
 { 
    
register_plugin"Loading Song""1.0""Torch" );
    
register_event"ResetHUD""song""b" );
    
register_event"TextMsg""song""b""2&#Spec_Mode" );


public 
song( const id 
{
    switch ( 
cs_get_user_teamid ) )
    {
        case 
CS_TEAM_SPECTATORCS_TEAM_UNASSIGNED :
        {
            if ( !
playingid ] )
            {
                
set_task0.5"play_song_task"id );
                
playingid ] = true;
            }
        }
        default :
        {
            
client_cmdid"mp3 stop" );
            
playingid ]= false;
        }
    }
}

public 
play_song_task( const id )
{
    
client_cmdid"mp3 play %s"gSound );

Arkshine is offline
Reply



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 06:26.


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