Raised This Month: $ Target: $400
 0% 

Song all Time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
valfarx
Member
Join Date: May 2011
Old 05-01-2012 , 14:57   Song all Time
Reply With Quote #1

hello, i want a Plugin, that play a song all the time that you enter in the server, and when the song finish, start again.
No i just have this plugin:

PHP Code:
#include <amxmodx>
#define PLUGIN "Musica"
#define VERSION "616"
#define AUTHOR "Lunatiko!"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_connect(id)

client_cmd(id"mp3 loop sound/song/song.mp3")

public 
plugin_precache()
{
    
precache_generic("sound/song/song.mp3")



But this Plugin, just play the song in the Loading. I want the song continue, all the time Without need of a new round to play the song. You will be enter to the server, and the song playing always. No matter if u put sv_restart or something, always playing. Or a Task when you enter, the song start to play at 3 seg, and never stop. Sorry for my bad english.
valfarx is offline
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 05-01-2012 , 17:33   Re: Song all Time
Reply With Quote #2

PHP Code:
#include <amxmodx>
#define PLUGIN "Musica"
#define VERSION "616"
#define AUTHOR "Lunatiko!"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
plugin_precache()
{
    
precache_generic("sound/song/song.mp3")


public 
client_putinserver(id)
{
    
client_cmd(id"mp3 sound/song/song.mp3")
    
client_print(id"Song is playing")

__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.

Last edited by Bilal Pro; 05-01-2012 at 17:37.
Bilal Pro is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-01-2012 , 17:36   Re: Song all Time
Reply With Quote #3

PHP Code:
#include <amxmodx>

#define PLUGIN "Musica"
#define VERSION "616"
#define AUTHOR "Lunatiko!"

new const gSoundFile[] = "sound/song/song.mp3";

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_connect(id)
{
    
client_cmd(id"mp3 loop %s"gSoundFile)
}

public 
client_putinserver(id)
{
    
client_cmd(id"mp3 loop %s"gSoundFile)
}

public 
plugin_precache()
{
    
precache_generic(gSoundFile)

@Bilal

You cannot use "spk" command with .mp3 files, and that command doesn't loop.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 05-01-2012 , 17:39   Re: Song all Time
Reply With Quote #4

My bad
__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.
Bilal Pro is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-01-2012 , 17:43   Re: Song all Time
Reply With Quote #5

For normal play, it is "mp3 play sound.mp3".
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
valfarx
Member
Join Date: May 2011
Old 05-01-2012 , 19:06   Re: Song all Time
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
PHP Code:
#include <amxmodx>

#define PLUGIN "Musica"
#define VERSION "616"
#define AUTHOR "Lunatiko!"

new const gSoundFile[] = "sound/song/song.mp3";

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_connect(id)
{
    
client_cmd(id"mp3 loop %s"gSoundFile)
}

public 
client_putinserver(id)
{
    
client_cmd(id"mp3 loop %s"gSoundFile)
}

public 
plugin_precache()
{
    
precache_generic(gSoundFile)

I try this, and work the same like plugin i post. The song play in the Loading, but when you are into the server, dont play anymore. Maybe if you can put a task that a 5 seg after you enter, play the music?

Last edited by valfarx; 05-01-2012 at 19:07.
valfarx is offline
valfarx
Member
Join Date: May 2011
Old 05-04-2012 , 00:42   Re: Song all Time
Reply With Quote #7

help
valfarx is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 05-04-2012 , 01:05   Re: Song all Time
Reply With Quote #8

PHP Code:
#include < amxmodx >

// Your MP3 sound file should be placed in:
//  %mygamedir%/sound/custom/my_soundscape.mp3

public plugin_precache( )
  
precache_sound"custom/my_soundscape.mp3" );

// EITHER
public client_putinserverClient )
  
client_cmdClient"mp3 play sound/custom/my_soundscape.mp3" );

// OR
public client_putinserverClient )
  
set_task3.0"TaskListenSound"Client );

public 
TaskListenSoundClient )
  if( 
is_user_connectedClient ) )
    
client_cmdClient"mp3 play sound/custom/my_soundscape.mp3" ); 
__________________

Last edited by claudiuhks; 05-05-2012 at 01:37.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
valfarx
Member
Join Date: May 2011
Old 05-05-2012 , 01:29   Re: Song all Time
Reply With Quote #9

Quote:
Originally Posted by claudiuhks View Post
PHP Code:
// OR
public client_putinserverClient )
  
set_task3.0"TaskListenSound"Client );

public 
TaskListenSoundClient )
  if( 
is_client_connectedClient ) )
    
client_cmdClient"mp3 play sound/custom/my_soundscape.mp3" ); 
is_client_connected: I cant compile because this is invalid, and i have to search about it, and is; is_user_connected.

mp3 play: I use; mp3 loop, of this way, when the song stop, start again.

Task was perfect, this plugin really help me. Thanks to all, so much for help me
pd: sorry for my bad english

Last edited by valfarx; 05-05-2012 at 02:21.
valfarx is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 05-05-2012 , 01:35   Re: Song all Time
Reply With Quote #10

Oh my God, is_user_connected, sorry for that!
__________________

Last edited by claudiuhks; 05-05-2012 at 01:35.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Reply


Thread Tools
Display Modes

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 07:41.


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