AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Sound problem (https://forums.alliedmods.net/showthread.php?t=171648)

Mr Dzx 11-08-2011 16:29

Sound problem
 
I've got a problem regarding sounds.
I've edited plugin called 'Map-end sounds' quite abit to suit my likings but when I was near finished and tested it, it didn't work. So I made few other changes and still it doesn't work, any advice?

Code:

#include <amxmodx>
#include <amxmisc>
#include < cstrike.inc >
#define MAX_PLAYERS 33

new PLUGIN[]="Mapend Sounds"
new AUTHOR[]="ntfs"
new VERSION[]="1.33"

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_cvar("mapend_sounds", VERSION, FCVAR_SERVER)
    set_task(1.0, "exec_sound", 0, "", 1, "d", 1)
    register_cvar("amx_mapend_sounds_advert", "1")
}

public plugin_precache() {
    precache_sound("drunkenninja.wav");
}

public exec_sound()
{
    client_cmd(0, "spk drunkenninja.wav");
}


Devil259 11-08-2011 18:30

Re: Sound problem
 
I think you don't need to set the .wav in the client_cmd( ) native.

What do you want to do ?

Mr Dzx 11-08-2011 23:49

Re: Sound problem
 
Quote:

Originally Posted by Devil259 (Post 1592987)
I think you don't need to set the .wav in the client_cmd( ) native.

What do you want to do ?

I want it to play the drunkenninja.wav file.

Devil259 11-09-2011 06:59

Re: Sound problem
 
When do you want to play it ?

Napoleon_be 11-10-2011 06:44

Re: Sound problem
 
PHP Code:

public plugin_precache() {
        
precache_sound("FOLDER/SOUND.wav")
}

public 
exec_sound(id) {
        
client_cmd(0"spk FOLDER/SOUND.wav")


Example: client_cmd(0, "spk misc/mysound.wav")

ConnorMcLeod 11-10-2011 11:23

Re: Sound problem
 
If drunkenninja.wav is in sound/ folder it's ok.
Sound has to be MONO.

Mix97 11-11-2011 07:40

Re: Sound problem
 
Quote:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define MAX_PLAYERS 33

#define SOUND = "misc/drunkenninja.wav"

new PLUGIN[]="Mapend Sounds"
new AUTHOR[]="ntfs"
new VERSION[]="1.33"

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("mapend_sounds", VERSION, FCVAR_SERVER)
set_task(1.0, "exec_sound", 0, "", 1, "d", 1)
register_cvar("amx_mapend_sounds_advert", "1")
}

public plugin_precache() {
precache_sound(SOUND);
}

public exec_sound()
{
client_cmd(0, "spk SOUND");
}
Not Tested.

Napoleon_be 11-11-2011 10:55

Re: Sound problem
 
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

new const iSound[] = "misc/drunkenninja.wav"

new PLUGIN[]="Mapend Sounds"
new AUTHOR[]="ntfs"
new VERSION[]="1.33"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_cvar("mapend_sounds"VERSIONFCVAR_SERVER)
    
set_task(1.0"exec_sound"0""1"d"1)
    
register_cvar("amx_mapend_sounds_advert""1")
}

public 
plugin_precache() {
    for(new 
0sizeof(iSound); i++) {
        
precache_sound(iSound[i])
    }
}

public 
exec_sound()
{
    
client_cmd(0"spk misc/drunkenninja.wav");


Didn't test this yet, but this should work.


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

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