Raised This Month: $60 Target: $400
 15% 

Connect Sound (v1.2.3)


Post New Thread Reply   
 
Thread Tools Display Modes
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 02-17-2009 , 05:35   Re: Connect Sound (v1.2)
Reply With Quote #21

change:
Code:
client_cmd(id, "spk ^"%s^"", soundlist[i])
to:
Code:
client_cmd(id, "mp3 play ^"%s^"", soundlist[i])
change:
Code:
format(temp, 127, "sound/%s.wav", soundlist[a])
if ( file_exists(temp) )
{
	new soundfile[128]
	format(soundfile, 127, "%s.wav", soundlist[a])
	precache_sound(soundfile)
}
to:
Code:
format(temp, 127, "%s.mp3", soundlist[a])
if ( file_exists(temp) )
	precache_generic(temp)
also do not forget to changed the "soundlist" to match mp3s with full path
__________________
alias White Panther

Last edited by karlos; 02-17-2009 at 12:21.
karlos is offline
chrisb
Junior Member
Join Date: Feb 2009
Old 02-17-2009 , 12:08   Re: Connect Sound (v1.2)
Reply With Quote #22

Hi karlos,

i am sry it does not work.
I think u haven't the same version like on page one.

U said change
Code:
format(temp, 127, "sound/%s.wav", soundlist[a])
if ( file_exists(temp) )
{
    format(soundfile, 127, "%s.wav", soundlist[a])
    precache_sound(soundfile)
}
but orignal version is

Code:
 
        format(temp,127,"sound/%s.wav", soundlist[a])
        if ( file_exists(temp) ){
            new soundfile[128]
            format(soundfile,127,"%s.wav", soundlist[a])
            precache_sound( soundfile )
        }
When I start to compile, i get a lot of errors.
I tried to figure it out, but my amxx coding knowledge is not enough.

The other example has a problem with spaces.
Code:
client_cmd(id, "mp3 play ^"%s^"",soundlist[i])
There were one to much behind soundlist.

Greets chris
chrisb is offline
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 02-17-2009 , 12:22   Re: Connect Sound (v1.2)
Reply With Quote #23

edited the post above
__________________
alias White Panther
karlos is offline
chrisb
Junior Member
Join Date: Feb 2009
Old 02-18-2009 , 08:40   Re: Connect Sound (v1.2)
Reply With Quote #24

Works awesome.
Thanks karlos
chrisb is offline
niFe
Senior Member
Join Date: Apr 2008
Location: Planet Green
Old 04-27-2009 , 11:23   Re: Connect Sound (v1.2)
Reply With Quote #25

Code:
/*
* Plays a welcome sound to the player who connects
*
* by White Panther
*
* v1.0
*
* v1.1:
*    - addition to add easily own sounds
*
* v1.2.1:
*    - bug with not playing sounds to client fixed
*    - added file exist check for soundfile
*
* v1.2.3:
*    - changes:
*        - way of giving id to timer
*/

#include <amxmodx>

// change this number to the amount of sounds u have
#define Maxsounds 1

// add here your sounds, sounds must be somewhere in <ModDir>/sounds
// format must be like: {"misc/sound1","ambience/sound2"}
new soundlist[Maxsounds][] = {"misc/sound1"}

new plugin_author[] = "White Panther"
new plugin_version[] = "1.2.3"

public plugin_init(){
    register_plugin("Connect Sound",plugin_version,plugin_author)
    register_cvar("connectsound_version",plugin_version,FCVAR_SERVER)
}

public plugin_precache(){
    for ( new a = 0; a < Maxsounds; a++ ){
        new temp[128]
        format(temp, 127, "%s.mp3", soundlist[a])
if ( file_exists(temp) )
    precache_generic(temp)
    }
}

public client_putinserver(id){
    set_task(1.0,"consound",100+id)
}

public consound(timerid_id){
    new id = timerid_id - 100
    new Usertime
    Usertime = get_user_time(id, 0)
    if ( Usertime <= 0 ){
        set_task(1.0,"consound",timerid_id)
    }else{
        new i = random(Maxsounds)
        client_cmd(id, "mp3 play ^"%s^"", soundlist[i])
    }
    
    return PLUGIN_CONTINUE
}
Gets me an error when I compile it.
__________________
niFe is offline
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 04-27-2009 , 14:42   Re: Connect Sound (v1.2)
Reply With Quote #26

it is not the original code, so at least post your error if you need help
__________________
alias White Panther
karlos is offline
niFe
Senior Member
Join Date: Apr 2008
Location: Planet Green
Old 04-27-2009 , 17:53   Re: Connect Sound (v1.2)
Reply With Quote #27

Quote:
Originally Posted by karlos View Post
it is not the original code, so at least post your error if you need help
It's from yours, you told up there ^ to put that for .mp3

Let me work with it a bit more and I'll let you know.
__________________
niFe is offline
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 04-27-2009 , 19:45   Re: Connect Sound (v1.2)
Reply With Quote #28

and again you did not post the error you got
but i think you have an indentation error: make sure you have the needed tabs or spaces
__________________
alias White Panther
karlos is offline
niFe
Senior Member
Join Date: Apr 2008
Location: Planet Green
Old 04-28-2009 , 21:36   Re: Connect Sound (v1.2)
Reply With Quote #29

Quote:
Originally Posted by karlos View Post
and again you did not post the error you got
but i think you have an indentation error: make sure you have the needed tabs or spaces
Didn't post errors cause I think I can take care of it if i debug it.
Alright thanks.
__________________
niFe is offline
-(L-S)-LAT
Member
Join Date: Jun 2009
Old 07-11-2009 , 17:22   Re: Connect Sound (v1.2)
Reply With Quote #30

Hey I hope you can find a solution.
I get no music while I wait for the download to be finished until after I have entered the server and press ok to go to the page where you choose teams and you have to press ok. and while playing my music.

it should preferably be at loading time.

Nice voice welcome plugin but no loading sound

Last edited by -(L-S)-LAT; 07-11-2009 at 19:13. Reason: my bad english
-(L-S)-LAT is offline
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 13:30.


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