Raised This Month: $ Target: $400
 0% 

Help with d plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
12345
Senior Member
Join Date: Dec 2004
Old 03-10-2006 , 23:05   Help with d plugin
Reply With Quote #1

Hey guyz, can some1 help with plugin?
Well how 2 tell this plugin, 2 take the sounds from the misc misc folder.
This plugin is loading sounds, when some1 comes in server, it plays a sound from valve/valve/media folder but how 2 tell him 2 play a sound from valve/cstrike/sound/misc folder???

Code:
 /*
* Play a sound during the connection.
*
* Random code part taken from plugin
* connectsound by White Panther
*
* v1.0
*
*/

#include <amxmodx>
#define Maxsounds 6

// sounds localized in gcf cache (valve/media)
// you can add more song if you want.
new soundlist[Maxsounds][] = {"Half-Life03","Half-Life14","Half-Life08","Half-Life11","Half-Life14","Half-Life15"}

public client_connect(id) {
	new i
	i = random_num(0,Maxsounds-1)
	client_cmd(id,"mp3 play media/%s",soundlist[i])
	return PLUGIN_CONTINUE
}

public plugin_init() {
	register_plugin("Amx Dev Team","1.6","st")
	return PLUGIN_CONTINUE
}
Code:
 client_cmd(id,"wav play valve/cstrike/sound/misc/%s",soundlist[i])   

NOT WORKING and other else ways 2 :(
If some1 can, then PLZZZZ tell me
12345 is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 03-10-2006 , 23:42  
Reply With Quote #2

1. That plugin plays sounds already precached by the client. In order to "point" it to another file, you must precache it. To precache, here is an example
Code:
public plugin_precache()      precache_sound("misc/myfile.mp3")
you have to do precache_sound for each sound file you plan on using.
2. Where new soundlist blah blah is, rename the Half-Life files to the name of the files you are precaching following the format already in the plugin.
3. Inside client_connect, change media/%s to misc/%s. Since its using "mp3 play media/%s", make sure the files you want to use are mp3 files.
4. I forgot the command to have it play waves, but I know its not "wav play". If I remember, I'll tell you.

NOTE: Mp3 files are usually big(1mb or more) so I suggest you convert them to wave, then convert them to a smaller file size. Y wave first? If you try to compress an mp3 file you get major sound loss. I was able to get my mp3s down to less than 1mb and still maitained exceptional sound quality(they were optimized streaming file types) Hope I helped.
organizedKaoS is offline
12345
Senior Member
Join Date: Dec 2004
Old 03-11-2006 , 03:32  
Reply With Quote #3

You helped sooo muchh thanxxzz alot yaa
12345 is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 03-11-2006 , 03:45  
Reply With Quote #4

organizedKaoS is offline
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 20:28.


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