AlliedModders

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

extreem 04-20-2011 18:23

Help with sound
 
HI. I need help with sound.
I want to play sound on open menu.
Here is my function for open menu:
PHP Code:

public mymenu(id){
    
menu_display(idgMyMenu,0);
    
ColorChat(idGREEN"Pouzivaj tlacitko ^3P^4, pro zobrazeni menu")
    
client_print(idprint_center"Pouzivaj tlacitko P, pro zobrazeni menu")
    return 
PLUGIN_HANDLED;



Rirre 04-20-2011 18:40

Re: Help with sound
 
PHP Code:

public mymenu(id){
    
menu_display(idgMyMenu,0);
    
ColorChat(idGREEN"Pouzivaj tlacitko ^3P^4, pro zobrazeni menu")
    
client_print(idprint_center"Pouzivaj tlacitko P, pro zobrazeni menu")
    
client_cmd(id"spk mymenu"// Play "sound/mymenu.wav"
    
return PLUGIN_HANDLED;
}

public 
plugin_precache()
    
precache_sound("mymenu.wav"


extreem 04-20-2011 18:56

Re: Help with sound
 
Don't work :(

fysiks 04-20-2011 19:35

Re: Help with sound
 
Quote:

Originally Posted by extreem (Post 1454437)
Don't work :(

What did you try? And, where did you put the sound file?

extreem 04-21-2011 07:18

Re: Help with sound
 
plugin was compiled, in CS I was download that file, but when I open my menu I dont have sound

Rirre 04-21-2011 09:33

Re: Help with sound
 
if its a mp3 file, you have to change
PHP Code:

client_cmd(id"spk mymenu"

to:
PHP Code:

client_cmd(id"mp3 play sound/mymenu"

Check if the .mp3 file is "mono" and not "stereo".
Otherwise you have to convert it to mono.

extreem 04-21-2011 09:58

Re: Help with sound
 
2 Attachment(s)
Look please. Full code
PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "sound"
#define VERSION "1.0"
#define AUTHOR "Extreem"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /audio""audio")
}
public 
audio(id){
    
client_cmd(id"spk sound")  
    
client_print(idprint_chat"Plugin is work")
}
public 
plugin_precache()
    
precache_sound("sound.wav"

Some screens:

extreem 04-21-2011 10:01

Re: Help with sound
 
1 Attachment(s)
And screen in game


All times are GMT -4. The time now is 19:51.

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