Ei gente alguem pode arrumar esse plugin de dropar ovos, eu quero que quando
eu pego um ovo ele faz um som.
eu pego um ovo ele faz um som.
- 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;
}