AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Music player. (https://forums.alliedmods.net/showthread.php?t=101458)

Mr.Noobie 08-24-2009 04:27

Music player.
 
Why doesn't it work ?

PHP Code:

#include <amxmodx>
 
new NewDivide[ ] = { "music/NewDivide.mp3" }
 
public 
plugin_init( ) 
{
        
register_plugin"Music Player""1.0""Mr.Noobie" )
}
 
public 
plugin_precache( )
{
        
precache_soundNewDivide )
}
 
public 
client_putinserverid )
{
        
client_cmdid"spk %s"NewDivide )


I thought it play when user already connected to the server ?

Exolent[jNr] 08-24-2009 04:31

Re: Music player.
 
precache_sound( ) and "spk" are for .wav files.

PHP Code:

#include <amxmodx>
 
new NewDivide[ ] = { "sound/music/NewDivide.mp3" }
 
public 
plugin_init( ) 
{
        
register_plugin"Music Player""1.0""Mr.Noobie" )
}
 
public 
plugin_precache( )
{
        
precache_genericNewDivide )
}
 
public 
client_putinserverid )
{
        
client_cmdid"mp3 play %s"NewDivide )



Mr.Noobie 08-24-2009 05:47

Re: Music player.
 
Quote:

Originally Posted by Exolent[jNr] (Post 911042)
precache_sound( ) and "spk" are for .wav files.

PHP Code:

#include <amxmodx>
 
new NewDivide[ ] = { "sound/music/NewDivide.mp3" }
 
public 
plugin_init( ) 
{
        
register_plugin"Music Player""1.0""Mr.Noobie" )
}
 
public 
plugin_precache( )
{
        
precache_genericNewDivide )
}
 
public 
client_putinserverid )
{
        
client_cmdid"mp3 play %s"NewDivide )




Still it doesn't work.

Arkshine 08-24-2009 05:56

Re: Music player.
 
The code is fine, so it means either :

- you don't have put your file in the right directroy ;
- your MP3 volume is set to 0 ;
- The mp3 is badly encoded.

So check if your sound is in the right place, if mp3 volume is not set to 0 ( cs option ) and try to re-encode your file.

Mr.Noobie 08-25-2009 06:43

Re: Music player.
 
Quote:

Originally Posted by Arkshine (Post 911090)
The code is fine, so it means either :

- you don't have put your file in the right directroy ;
- your MP3 volume is set to 0 ;
- The mp3 is badly encoded.

So check if your sound is in the right place, if mp3 volume is not set to 0 ( cs option ) and try to re-encode your file.

I put the music at correct places, i also have the NewDivide.mp3.ztmp file.

The mp3 is not badly encoded because i test it on the round start music it works.

But this plugin doesn't work for me.

Arkshine 08-25-2009 06:59

Re: Music player.
 
You're right, it doesn't work at this moment, probably because all sounds are stopped when you arrive on the server. client_connect/authorized works. You want to play it when exactly ? You can play at player's spawn, or after choosing the team.

Mr.Noobie 08-25-2009 07:22

Re: Music player.
 
Quote:

Originally Posted by Arkshine (Post 912259)
You're right, it doesn't work at this moment, probably because all sounds are stopped when you arrive on the server. client_connect/authorized works. You want to play it when exactly ? You can play at player's spawn, or after choosing the team.

I want the music to play when client has connected to the server.

Mr.Noobie 09-19-2009 07:52

Re: Music player.
 
Quote:

Originally Posted by Arkshine (Post 911090)
The code is fine, so it means either :

- you don't have put your file in the right directroy ;
- your MP3 volume is set to 0 ;
- The mp3 is badly encoded.

So check if your sound is in the right place, if mp3 volume is not set to 0 ( cs option ) and try to re-encode your file.

How do i make it good encoded ?

Arkshine 09-19-2009 08:02

Re: Music player.
 
Use an audio software. Sometimes it needs just to be saved again without any changes, or you have to encode to something standard.

Mr.Noobie 09-19-2009 08:25

Re: Music player.
 
Quote:

Originally Posted by Arkshine (Post 937471)
Use an audio software. Sometimes it needs just to be saved again without any changes, or you have to encode to something standard.

Can you provide me the Audio Software. what you mean by save ?

1. Question.

This is 2 song and above right ?

new const Music[ ][ ]= { "sound/music/28week.mp3", "sound/music/wwwooot.mp3" }


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

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