AlliedModders

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

sQn 11-09-2007 10:30

Problem.
 
I wont block standart radio sound ct_fireinhole.wav

PHP Code:

#include <amxmodx> 
#include <amxmisc>
#include <engine>
#include <csx>
#include <fakemeta>
new g_RadioTimer[33]
new 
wital[33]
public 
plugin_init(){
 
 
register_plugin("Custom Grenades sounds","1.0","sQn")
 
register_cvar("amx_real_radio""1")
         
 
register_forward(FM_EmitSound,"fw_emitsound");
 return 
PLUGIN_CONTINUE  
}
public 
msg_audio()
{
    if(
get_msg_args() != || get_msg_argtype(2) != ARG_STRING) {
        return 
PLUGIN_CONTINUE
    
}
    new 
arg2[20]
    
get_msg_arg_string(2arg219)
    if(
equal(arg2[1], "!MRAD_FIREINHOLE"))
    {
  return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE
}
public 
fw_emitsound(entity,channel,const sample[],Float:volume,Float:attenuation,fFlags,pitch)
{
    if(
equali(sample,"radio/ct_fireinhole.wav"))
    return 
FMRES_SUPERCEDE;
    
    
    return 
FMRES_IGNORED;
}
public 
grenade_throw(id,ent,wid)
{
 if (
get_cvar_num("amx_real_radio"))
 {
 
wital[id] = 1
 
new randomizer[33]
 
randomizer[id] = (random_num(1,2))
 
 if(
randomizer[id] == 1)
 {
 
emit_sound(id,CHAN_AUTO"voi/g1.wav"1.0ATTN_NORM0PITCH_NORM
 }
 else if(
randomizer[id] == 2)
 {
 
emit_sound(id,CHAN_AUTO"voi/g2.wav"1.0ATTN_NORM0PITCH_NORM
 }
 
 }
 return 
PLUGIN_HANDLED
}
 
public 
radiotimer(id) {
 
g_RadioTimer[id] = 0
 
return PLUGIN_HANDLED
}
public 
client_connect(id) {
 
g_RadioTimer[id] = 0
}
public 
client_disconnect(id) {
 
g_RadioTimer[id] = 0
}
public 
plugin_precache()
{
 
precache_sound"voi/g1.wav")
 
precache_sound"voi/g2.wav")
 return 
PLUGIN_CONTINUE



Wilson [29th ID] 11-09-2007 10:48

Re: Problem.
 
It's been a while since CS...but if I remember correctly, as of v1.5 the radio commands were not emit_sounds...as in the enemies couldn't hear them.

You probably have to block a PlaybackEvent or something. Not sure where radio commands come from but if I remember right, it's definitely not emit_sound. Not proximity based at all.

ConnorMcLeod 11-09-2007 11:15

Re: Problem.
 
You can use VEN's plugin :
http://forums.alliedmods.net/showthread.php?p=193239

sQn 11-09-2007 14:35

Re: Problem.
 
No i write my plug-in.I don't based on VEN plug-in.Sorry for cvar amx_real_radio

Wilson [29th ID] 11-10-2007 09:31

Re: Problem.
 
No.

You can find out how to do it from VEN's plug-in.

Wy możecie wyjaśniać jak robić to od *VEN's* plug-in.


All times are GMT -4. The time now is 01:17.

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