AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with d plugin (https://forums.alliedmods.net/showthread.php?t=25274)

12345 03-10-2006 23:05

Help with d plugin
 
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 :(

organizedKaoS 03-10-2006 23:42

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.

12345 03-11-2006 03:32

You helped sooo muchh thanxxzz alot yaa

organizedKaoS 03-11-2006 03:45

:lol: :lol: :lol: :lol: :lol:


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

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