Raised This Month: $ Target: $400
 0% 

client_putinserver, play sound for connected player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 06-17-2009 , 07:01   client_putinserver, play sound for connected player
Reply With Quote #1

Hi , I have this :
PHP Code:
public client_putinserver(id)
{
     
client_cmd(id"mp3 play %s"music[1])

Why it won't play to client who is connected?
xbatista is offline
Send a message via Skype™ to xbatista
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-17-2009 , 07:03   Re: client_putinserver, play sound for connected player
Reply With Quote #2

Try another MP3 file. Also are you sure that the file path has no spaces?

Provide more code (like what is music[1]).
__________________
hleV is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 06-17-2009 , 07:03   Re: client_putinserver, play sound for connected player
Reply With Quote #3

PHP Code:
new const music[][] = {
    
"sound/umbrella/warn.mp3",
    
"sound/umbrella/joined.mp3"
}

public 
plugin_precache() {
    for(new 
0sizeof musici++)
        
precache_generic(music[i])

xbatista is offline
Send a message via Skype™ to xbatista
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-17-2009 , 07:07   Re: client_putinserver, play sound for connected player
Reply With Quote #4

If it doesn't play, that means that this MP3 is not compatible with HL engine.
__________________
hleV is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 06-17-2009 , 07:21   Re: client_putinserver, play sound for connected player
Reply With Quote #5

Okey,converted to 64 bit rate, size 240kb.
Also tryied other mp3's still not playing
xbatista is offline
Send a message via Skype™ to xbatista
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-17-2009 , 07:27   Re: client_putinserver, play sound for connected player
Reply With Quote #6

Try this:
Code:
public client_putinserver(id)         set_task(2.0, "taskPlaySnd", id);   public taskPlaySnd(id)         client_cmd(id, "mp3 play %s", music[1]);
I remember something like if player starts playing an MP3 while he's connecting (on client_connect() or client_authorized()), the sound stops on client_putinserver(). So that's why you should try to do that AFTER it.
__________________
hleV is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 06-17-2009 , 07:40   Re: client_putinserver, play sound for connected player
Reply With Quote #7

OKey will try :0
xbatista is offline
Send a message via Skype™ to xbatista
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 06-17-2009 , 08:41   Re: client_putinserver, play sound for connected player
Reply With Quote #8

TESTED: Task did the trick thanks :]
xbatista is offline
Send a message via Skype™ to xbatista
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 06-17-2009 , 08:55   Re: client_putinserver, play sound for connected player
Reply With Quote #9

use in client_connect(). client_putinserver() stop all sounds in that moment
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 06-17-2009 , 09:26   Re: client_putinserver, play sound for connected player
Reply With Quote #10

No I want exactly in client_putinserver
xbatista is offline
Send a message via Skype™ to xbatista
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 15:29.


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