Участник
Пользователь
- Сообщения
- 2,143
- Реакции
- 1,225
- Помог
- 44 раз(а)
Как остановить звуки ".wav" в этом плагине?How to stop ".wav" sounds in this plugin ?
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <xs>
#define PLUGIN "Weapon Physics"
#define VERSION "3.0"
#define AUTHOR "Nomexous"
#define WEAPON_DROP "items/weapondrop1.wav"
new const classes_weapons[][] = { "weaponbox", "item_thighpack", "weapon_shield" }
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
for (new x; x < sizeof classes_weapons; x++)
{
RegisterHam(Ham_Touch, classes_weapons[x], "Weapon_Drop")
}
}
public plugin_precache()
{
precache_sound(WEAPON_DROP)
}
public Weapon_Drop(ent, id)
{
if(pev(id, pev_solid) < SOLID_BBOX)
return HAM_IGNORED
if(1 <= id <= 32)
return HAM_IGNORED
static Float:v[3]
pev(ent, pev_velocity, v)
if (xs_vec_len(v) > 700.0)
{
static Float:origin[3]
pev(ent, pev_origin, origin)
origin[0] += random_float(-10.0, 10.0)
origin[1] += random_float(-10.0, 10.0)
origin[2] += random_float(-10.0, 10.0)
}
xs_vec_mul_scalar(v, 0.4, v)
set_pev(ent, pev_velocity, v)
set_pev(ent, pev_movetype, MOVETYPE_BOUNCE)
emit_sound(ent, CHAN_WEAPON, WEAPON_DROP, 0.25, ATTN_STATIC, 0, PITCH_NORM)
return HAM_IGNORED
}
потому что пачка это тоже weaponbox, просто нужно получить m_iId объекта WeaponBox и поставить проверку на игнортак и не получилось у меня игнорировать физику для с4.. и в ini файл вписывал weapon_c4, и #define Half_Life закрывал.. не разобрался я короче)
// Copyright © 2016 Vaqtincha
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
new g_cvar, g_catched, HamHook:g_HamHookWpBox
public plugin_init()
{
register_plugin("Weapon Glow", "0.0.1", "Vaqtincha")
g_HamHookWpBox = RegisterHam(Ham_Spawn, "weaponbox", "HamSpawn_Weaponbox_Post", 1)
register_event ("HLTV", "Event_NewRound", "a", "1=0", "2=0")
g_cvar = register_cvar("weapon_glow", "1")
new ent = FM_NULLENT
while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", "armoury_entity")))
{
new r = random_num(1,255), g = random_num(1,255), b = random_num(1,255)
switch(get_pcvar_num(g_cvar))
{
case 1: fm_set_rendering(ent, kRenderFxGlowShell, r, g, b, kRenderNormal, 1)
case 2: fm_set_rendering(ent, kRenderFxGlowShell, 0, 255, 0, kRenderNormal, 1)
}
}
}
public Event_NewRound()
{
g_catched = get_pcvar_num(g_cvar)
if(!g_catched)
{
DisableHamForward(g_HamHookWpBox)
}else{
EnableHamForward(g_HamHookWpBox)
}
}
public HamSpawn_Weaponbox_Post(ent)
{
switch(g_catched)
{
case 1:{
new r = random_num(1,255), g = random_num(1,255), b = random_num(1,255)
fm_set_rendering(ent, kRenderFxGlowShell, r, g, b, kRenderNormal, 1)
}
case 2:{
new id = pev(ent, pev_owner)
switch(get_user_team(id))
{
case 1: fm_set_rendering(ent, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 1)
case 2: fm_set_rendering(ent, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 1)
}
}
}
}
stock fm_set_rendering(entity, fx=kRenderFxNone, r=255, g=255, b=255, render=kRenderNormal, amount=16)
{
new Float:RenderColor[3]
RenderColor[0] = float(r)
RenderColor[1] = float(g)
RenderColor[2] = float(b)
set_pev(entity, pev_renderfx, fx)
set_pev(entity, pev_rendercolor, RenderColor)
set_pev(entity, pev_rendermode, render)
set_pev(entity, pev_renderamt, float(amount))
return 1
}