Zplague
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Zplague Entrar

Seu portal de Zombie Plague no Brasil


description[Cod.] Modos de Sons Empty[Cod.] Modos de Sons

more_horiz
alguem poderia colocar esse jeito de som quando eu pego o ovo de packs.

Código:

new g_sound[] = { "zombie_plague/egg_pick_up.wav" }

ta ai o plugin

Código:

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

#define PLUGIN "[ZP] Dropar Ovos"
#define VERSION "1.0"
#define AUTHOR "Neukasano | Wilian | [P]erfec[T] [S]cr[@]s[H]"

new cvar_ap
new model[] = "models/Hwk/ZP2014/w_ovo.mdl"

public plugin_precache()
{
   precache_model(model)
}

public plugin_init()
{
   register_plugin(PLUGIN, VERSION, AUTHOR)
   
   register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
   register_forward(FM_Touch, "fwd_Touch")
   register_event("DeathMsg","event_deathmsg","a")
   
   cvar_ap = register_cvar("zp_give_ovo", "2")
}

public event_round_start()
{    
   new ent = FM_NULLENT
   static string_class[] = "classname"
   while ((ent = engfunc(EngFunc_FindEntityByString, ent, string_class, "ammo"))) 
      set_pev(ent, pev_flags, FL_KILLME)
}

public fwd_Touch(toucher, touched)
{
   if (!is_user_alive(toucher) || !pev_valid(touched))
      return FMRES_IGNORED
   
   new classname[32]
   pev(touched, pev_classname, classname, 31)
   
   if (!equal(classname, "ammo"))
      return FMRES_IGNORED
   
   zp_set_user_ammo_packs(toucher, zp_get_user_ammo_packs(toucher) + get_pcvar_num(cvar_ap))
   client_print(toucher, print_chat, "[Hawk's GaMes] Voce pegou um ovo e Ganhou 2 Ammo Pack(s).")
   set_pev(touched, pev_effects, EF_NODRAW)
   set_pev(touched, pev_solid, SOLID_NOT)
   
   return FMRES_IGNORED
}

public event_deathmsg()
{
   new origin[3]; get_user_origin(read_data(2) , origin)
   
   addItem(origin)
}

public addItem(origin[3])
{
   new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
   set_pev(ent, pev_classname, "ammo")
   
   engfunc(EngFunc_SetModel,ent, model)
   
   set_pev(ent, pev_mins, Float:{-10.0,-10.0,0.0})
   set_pev(ent, pev_maxs, Float:{10.0,10.0,25.0})
   set_pev(ent, pev_size, Float:{-10.0,-10.0,0.0,10.0,10.0,25.0})
   engfunc(EngFunc_SetSize, ent, Float:{-10.0,-10.0,0.0},Float:{10.0,10.0,25.0})
   
   set_pev(ent, pev_solid, SOLID_BBOX)
   set_pev(ent, pev_movetype, MOVETYPE_TOSS)
   
   new Float:fOrigin[3]
   ivecfvec(origin, fOrigin)
   set_pev(ent, pev_origin, fOrigin)
   
   set_pev(ent,pev_renderfx,kRenderFxGlowShell) 
   set_pev(ent,pev_rendercolor,Float:{255.0,0.0,0.0}) 
   
   new Float:velocity[3];
   pev(ent, pev_velocity, velocity);
   velocity[2] = random_float(265.0,285.0);
   set_pev(ent, pev_velocity, velocity)
   
}

stock ivecfvec(const IVec[3], Float:FVec[3])
{
   FVec[0] = float(IVec[0]);
   FVec[1] = float(IVec[1]);
   FVec[2] = float(IVec[2]);

   return 1;
}

eu quero que faz o som tipo quando eu pego o ovo ai que tive perto de mim faz o som tbm so que bem baixo.

description[Cod.] Modos de Sons EmptyRe: [Cod.] Modos de Sons

more_horiz
TA AI

SMA

Código:

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

#define PLUGIN "[ZP] Dropar Ovos"
#define VERSION "1.0"
#define AUTHOR "Neukasano | Wilian | [P]erfec[T] [S]cr[@]s[H]"

new cvar_ap
new model[] = "models/Hwk/ZP2014/w_ovo.mdl"
new g_sound[] = "zombie_plague/egg_pick_up.wav"

public plugin_precache()
{
   precache_model(model)
   precache_model(g_sound)
}

public plugin_init()
{
   register_plugin(PLUGIN, VERSION, AUTHOR)
   
   register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
   register_forward(FM_Touch, "fwd_Touch")
   register_event("DeathMsg","event_deathmsg","a")
   
   cvar_ap = register_cvar("zp_give_ovo", "2")
}

public event_round_start()
{    
   new ent = FM_NULLENT
   static string_class[] = "classname"
   while ((ent = engfunc(EngFunc_FindEntityByString, ent, string_class, "ammo"))) 
      set_pev(ent, pev_flags, FL_KILLME)
}

public fwd_Touch(toucher, touched)
{
   if (!is_user_alive(toucher) || !pev_valid(touched))
      return FMRES_IGNORED
   
   new classname[32]
   pev(touched, pev_classname, classname, 31)
   
   if (!equal(classname, "ammo"))
      return FMRES_IGNORED
   
   zp_set_user_ammo_packs(toucher, zp_get_user_ammo_packs(toucher) + get_pcvar_num(cvar_ap))
   client_print(toucher, print_chat, "[Hawk's GaMes] Voce pegou um ovo e Ganhou 2 Ammo Pack(s).")
   emit_sound(toucher, CHAN_WEAPON, g_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
   set_pev(touched, pev_effects, EF_NODRAW)
   set_pev(touched, pev_solid, SOLID_NOT)
   
   return FMRES_IGNORED
}

public event_deathmsg()
{
   new origin[3]; get_user_origin(read_data(2) , origin)
   
   addItem(origin)
}

public addItem(origin[3])
{
   new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
   set_pev(ent, pev_classname, "ammo")
   
   engfunc(EngFunc_SetModel,ent, model)
   
   set_pev(ent, pev_mins, Float:{-10.0,-10.0,0.0})
   set_pev(ent, pev_maxs, Float:{10.0,10.0,25.0})
   set_pev(ent, pev_size, Float:{-10.0,-10.0,0.0,10.0,10.0,25.0})
   engfunc(EngFunc_SetSize, ent, Float:{-10.0,-10.0,0.0},Float:{10.0,10.0,25.0})
   
   set_pev(ent, pev_solid, SOLID_BBOX)
   set_pev(ent, pev_movetype, MOVETYPE_TOSS)
   
   new Float:fOrigin[3]
   ivecfvec(origin, fOrigin)
   set_pev(ent, pev_origin, fOrigin)
   
   set_pev(ent,pev_renderfx,kRenderFxGlowShell) 
   set_pev(ent,pev_rendercolor,Float:{255.0,0.0,0.0}) 
   
   new Float:velocity[3];
   pev(ent, pev_velocity, velocity);
   velocity[2] = random_float(265.0,285.0);
   set_pev(ent, pev_velocity, velocity)
   
}

stock ivecfvec(const IVec[3], Float:FVec[3])
{
   FVec[0] = float(IVec[0]);
   FVec[1] = float(IVec[1]);
   FVec[2] = float(IVec[2]);
   
   return 1;
}

description[Cod.] Modos de Sons EmptyRe: [Cod.] Modos de Sons

more_horiz
ixi man , não sei o que deu, eu tou com a pasta e som escrito
tudo certo mais não ta indo , sendo que eu tenho a pasta e o som

description[Cod.] Modos de Sons EmptyRe: [Cod.] Modos de Sons

more_horiz
IMPOSSIVEL NAO PEGAR AGORA OBS: TESTEI


Código:

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

#define PLUGIN "[ZP] Dropar Ovos"
#define VERSION "1.0"
#define AUTHOR "Neukasano | Wilian | [P]erfec[T] [S]cr[@]s[H]"

new cvar_ap
new model[] = "models/Hwk/ZP2014/w_ovo.mdl"
new g_sound[] = "zombie_plague/galinha.wav"

public plugin_precache()
{
   precache_model(model)
   precache_model(g_sound)
}

public plugin_init()
{
   register_plugin(PLUGIN, VERSION, AUTHOR)
   
   register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
   register_forward(FM_Touch, "fwd_Touch")
   register_event("DeathMsg","event_deathmsg","a")
   
   cvar_ap = register_cvar("zp_give_ovo", "2")
}

public event_round_start()
{    
   new ent = FM_NULLENT
   static string_class[] = "classname"
   while ((ent = engfunc(EngFunc_FindEntityByString, ent, string_class, "ammo"))) 
      set_pev(ent, pev_flags, FL_KILLME)
}

public fwd_Touch(toucher, touched)
{
   if (!is_user_alive(toucher) || !pev_valid(touched))
      return FMRES_IGNORED
   
   new classname[32]
   pev(touched, pev_classname, classname, 31)
   
   if (!equal(classname, "ammo"))
      return FMRES_IGNORED
   
   zp_set_user_ammo_packs(toucher, zp_get_user_ammo_packs(toucher) + get_pcvar_num(cvar_ap))
   client_print(toucher, print_chat, "[Hawk's GaMes] Voce pegou um ovo e Ganhou 2 Ammo Pack(s).")
   emit_sound(toucher, CHAN_AUTO, g_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
   set_pev(touched, pev_effects, EF_NODRAW)
   set_pev(touched, pev_solid, SOLID_NOT)
   
   return FMRES_IGNORED
}

public event_deathmsg()
{
   new origin[3]; get_user_origin(read_data(2) , origin)
   
   addItem(origin)
}

public addItem(origin[3])
{
   new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
   set_pev(ent, pev_classname, "ammo")
   
   engfunc(EngFunc_SetModel,ent, model)
   
   set_pev(ent, pev_mins, Float:{-10.0,-10.0,0.0})
   set_pev(ent, pev_maxs, Float:{10.0,10.0,25.0})
   set_pev(ent, pev_size, Float:{-10.0,-10.0,0.0,10.0,10.0,25.0})
   engfunc(EngFunc_SetSize, ent, Float:{-10.0,-10.0,0.0},Float:{10.0,10.0,25.0})
   
   set_pev(ent, pev_solid, SOLID_BBOX)
   set_pev(ent, pev_movetype, MOVETYPE_TOSS)
   
   new Float:fOrigin[3]
   ivecfvec(origin, fOrigin)
   set_pev(ent, pev_origin, fOrigin)
   
   set_pev(ent,pev_renderfx,kRenderFxGlowShell) 
   set_pev(ent,pev_rendercolor,Float:{255.0,0.0,0.0}) 
   
   new Float:velocity[3];
   pev(ent, pev_velocity, velocity);
   velocity[2] = random_float(265.0,285.0);
   set_pev(ent, pev_velocity, velocity)
   
}

stock ivecfvec(const IVec[3], Float:FVec[3])
{
   FVec[0] = float(IVec[0]);
   FVec[1] = float(IVec[1]);
   FVec[2] = float(IVec[2]);
   
   return 1;
}

description[Cod.] Modos de Sons EmptyRe: [Cod.] Modos de Sons

more_horiz
tbm nao foi deu o msm erro

description[Cod.] Modos de Sons EmptyRe: [Cod.] Modos de Sons

more_horiz
ZaturN escreveu:
tbm nao foi deu o msm erro

colocou o sound na pasta sound/zombie_plague/galinha.wav ?

description[Cod.] Modos de Sons EmptyRe: [Cod.] Modos de Sons

more_horiz
sim

description[Cod.] Modos de Sons EmptyRe: [Cod.] Modos de Sons

more_horiz
privacy_tip Permissões neste sub-fórum
Não podes responder a tópicos
power_settings_newInicie sessão para responder