AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Add song when HUD shows? (https://forums.alliedmods.net/showthread.php?t=222867)

MrKiller2010 08-07-2013 12:11

Add song when HUD shows?
 
I want to add a small .wav sound when It shows the HUD message.
I mean at the same time as the Message shows..

PHP Code:

public FreeGame(id)
{
    
g_iCurrentGame GAME_FREEGAME
    
    set_hudmessage 
018430, -1.00.3500.15.00.10.1, -)  
    
show_hudmessage 0"[SWE-KUNG]: Enjoy Your FreeDay!!!!")


Thanks

Firippu 08-07-2013 13:19

Re: Add song when HUD shows?
 
PHP Code:

new g_szSound[]="/subfolder/example.wav"

public FreeGame(id

    
g_iCurrentGame GAME_FREEGAME

    set_hudmessage 
018430, -1.00.3500.15.00.10.1, -)
    
show_hudmessage 0"[SWE-KUNG]: Enjoy Your FreeDay!!!!")

    
client_cmd(0,"spk ^"%s^"",g_szSound
}

public 
plugin_precache() {
    
precache_generic(g_szSound)


or if the wav is built into the game you could probably get by with just
PHP Code:

public FreeGame(id)  
{  
    
g_iCurrentGame GAME_FREEGAME 

    set_hudmessage 
018430, -1.00.3500.15.00.10.1, -
    
show_hudmessage 0"[SWE-KUNG]: Enjoy Your FreeDay!!!!"

    
client_cmd(0,"spk ^""/subfolder/example.wav"^"")  




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

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