AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   bombdefsound help (https://forums.alliedmods.net/showthread.php?t=128241)

Amonel 05-30-2010 09:36

bombdefsound help
 
PHP Code:

#include <amxmodx>

#define PLUGIN    "bomb_defused"
#define AUTHOR    "AmoneL"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_message(get_user_msgid("TextMsg"), "eTextMsg")
}

public 
eTextMsg(msg_idmsg_destmsg_entity)
{
    static 
szMessage[64]
    
get_msg_arg_string(2szMessage63)
    if(
equali(szMessage"#Bomb_Defused"))
        
set_msg_arg_string(2"B o m b   d e f u s e d !")


i want to make players exec sound "radio/bombdef.wav", i tried cliend_cmd spk.. but doesn't work

also using http://forums.alliedmods.net/showthread.php?t=98643 will freeze my server :)

Brreaker 05-30-2010 09:42

Re: bombdefsound help
 
Any error using spk?
Also, when you precache the sound, the folder sound is automatically loaded, so you would precache /bombdefuse/bomb.wav, that would mean sounds/precache/bombdefuse/bomb.wav :)

Amonel 05-30-2010 09:48

Re: bombdefsound help
 
sounds/radio/bombdef.wav is a default sound... no need to precache :)

unnyquee 05-30-2010 10:00

Re: bombdefsound help
 
PHP Code:

#include <amxmodx>

#pragma semicolon 1

new const g_szText[]  = "B o m b   D e f u s e d !";


public 
plugin_init()
{
      
register_plugin("bomb_defused""1.0""Amonel");
      
      
register_message(get_user_msgid("TextMsg"), "Message_TextMsg");
      
      
register_event("TextMsg""Event_TextMsg""a");
}

public 
Message_TextMsg(iMsgIDiMsgDestiReceiver)
{
      new 
szMessage[64];
      
      
get_msg_arg_string(2szMessagecharsmax(szMessage));
      
      if(
equali(szMessage"#Bomb_Defused"))
            
set_msg_arg_string(2g_szText);
      
      return 
PLUGIN_CONTINUE;
}

public 
Event_TextMsg()
{
      new 
szMessage[64];
      
      
read_data(2szMessagecharsmax(szMessage));
      
      if(
equali(szMessageg_szText))
            
client_cmd(0"spk radio/bombdef.wav");
      
      return 
PLUGIN_CONTINUE;


Not tested.


All times are GMT -4. The time now is 05:25.

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