AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   client_putinserver, play sound for connected player (https://forums.alliedmods.net/showthread.php?t=94921)

xbatista 06-17-2009 07:01

client_putinserver, play sound for connected player
 
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?

hleV 06-17-2009 07:03

Re: client_putinserver, play sound for connected player
 
Try another MP3 file. Also are you sure that the file path has no spaces?

Provide more code (like what is music[1]).

xbatista 06-17-2009 07:03

Re: client_putinserver, play sound for connected player
 
PHP Code:

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

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



hleV 06-17-2009 07:07

Re: client_putinserver, play sound for connected player
 
If it doesn't play, that means that this MP3 is not compatible with HL engine.

xbatista 06-17-2009 07:21

Re: client_putinserver, play sound for connected player
 
Okey,converted to 64 bit rate, size 240kb.
Also tryied other mp3's still not playing

hleV 06-17-2009 07:27

Re: client_putinserver, play sound for connected player
 
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.

xbatista 06-17-2009 07:40

Re: client_putinserver, play sound for connected player
 
OKey will try :0

xbatista 06-17-2009 08:41

Re: client_putinserver, play sound for connected player
 
TESTED: Task did the trick thanks :]

AntiBots 06-17-2009 08:55

Re: client_putinserver, play sound for connected player
 
use in client_connect(). client_putinserver() stop all sounds in that moment :D

xbatista 06-17-2009 09:26

Re: client_putinserver, play sound for connected player
 
No I want exactly in client_putinserver


All times are GMT -4. The time now is 15:29.

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