Ahh tengo esta bomba hace ratos & como ya ni entro la daré por acá sirve la eh usado pero si no la puedo arreglar jaja.
tengo más granadas por ahí si necesitan.
-Primero
-Segundo
-Tercero
-Cuarto
Al final de todo code agregamos esto:
-quinto
-Sexto
vamos a replace_weapon_models(id, weaponid)
buscan el case de la bomba frost que es la flash
& lo dejan así
EDIT; a la vergaaa tenia muchas cosas que no usaba & las quite cualquier error me dicen o duda así la reparo o lo que sea xd
pd; tengo otras bombas como la aniquiladora, pumpkit, rayo, jump, fire, toxica etc. por si quieren xd
tengo más granadas por ahí si necesitan.
-Primero
buscamos
& debajo agregamos
o en tal caso que tenga otra granada agregan el numero que va.
Código PHP:
const NADE_TYPE_FLARE = 4444
Código PHP:
const NADE_TYPE_PIPEBOMB = 5555
-Segundo
Creamos constantes & variables que registraran sonidos, models etc.
esto pueden ponerlo abajo de los includes si quieren
esto pueden ponerlo abajo de los includes si quieren
Código PHP:
new const g_firespr[] = "sprites/zerogxplode.spr";
new const g_sound[] = "zombie_plague/pipe_beep.wav";
new const g_vmodel[] = "models/zombie_plague/v_pipe.mdl";
new const g_pmodel[] = "models/zombie_plague/p_pipe.mdl";
new const g_wmodel[] = "models/zombie_plague/w_pipe.mdl";
new cvar_radius, cvar_damage
new g_fire, bool:sz_pipe[33]
-Tercero
le asignamos valor a las variables que creamos antes.
nos vamos a
& dentro de las llaves donde sientan más como agregan esto.
& precacheamos dichos archivos que usaremos en esta bomba
para eso nos vamos a
siempre dentro de la misma donde sientan más como agregan
nos vamos a
Código PHP:
public plugin_init()
Código PHP:
cvar_radius = register_cvar ( "zp_pipe_radius", "500");
cvar_damage = register_cvar("zp_pipe_damage", "1400.0");
& precacheamos dichos archivos que usaremos en esta bomba
para eso nos vamos a
Código PHP:
public plugin_precache() {
Código PHP:
precache_model(g_vmodel);
precache_model(g_pmodel);
precache_model(g_wmodel);
precache_sound(g_sound);
g_fire = precache_model(g_firespr);
-Cuarto
Al final de todo code agregamos esto:
Código PHP:
public hook(entity)
{
if (!pev_valid(entity))
{
remove_task(entity)
return
}
emit_sound(entity, CHAN_WEAPON, g_sound, 1.0, ATTN_NORM, 0, PITCH_HIGH);
static Float:entOrigin[3], flOrigin[3], PlayerPos[3], distance
pev(entity, pev_origin, entOrigin);
flOrigin[0] = floatround(entOrigin[0])
flOrigin[1] = floatround(entOrigin[1])
flOrigin[2] = floatround(entOrigin[2])
for (new i = 1; i <= g_maxplayers; i++)
{
if(!is_user_alive(i) || !g_zombie[i])
continue
get_user_origin(i, PlayerPos)
distance = get_distance(PlayerPos, flOrigin)
if (distance <= get_pcvar_num(cvar_radius))
{
new Float:fl_Velocity[3]
if (distance > 25)
{
new Float:fl_Time = distance / 650.0
fl_Velocity[0] = (flOrigin[0] - PlayerPos[0]) / fl_Time
fl_Velocity[1] = (flOrigin[1] - PlayerPos[1]) / fl_Time
fl_Velocity[2] = (flOrigin[2] - PlayerPos[2]) / fl_Time
}
else
{
fl_Velocity[0] = 0.0
fl_Velocity[1] = 0.0
fl_Velocity[2] = 0.0
}
entity_set_vector(i, EV_VEC_velocity, fl_Velocity)
}
}
}
public deleteGren(entity)
{
if (!pev_valid(entity))
return
new Float:originF[3]
pev(entity, pev_origin, originF);
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_EXPLOSION)
engfunc(EngFunc_WriteCoord, originF[0])
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2])
write_short(g_fire) //sprite index
write_byte(25) // scale in 0.1's
write_byte(10) // framerate
write_byte(0) // flags
message_end()
static flOrigin[3], PlayerPos[3], distance
pev(entity, pev_origin, originF);
new attacker = pev(entity, pev_owner)
flOrigin[0] = floatround(originF[0])
flOrigin[1] = floatround(originF[1])
flOrigin[2] = floatround(originF[2])
for (new i = 1; i <= g_maxplayers; i++)
{
if(is_user_alive(i))
{
if(!is_user_alive(i) || !g_zombie[i])
continue
get_user_origin(i, PlayerPos)
distance = get_distance(PlayerPos, flOrigin)
if (distance <= get_pcvar_num(cvar_radius))
{
if(get_user_health(i) - get_pcvar_float(cvar_damage) > 0)
fakedamage(i, "Pipe Bomb", get_pcvar_float(cvar_damage), 256);
else
ExecuteHamB(Ham_Killed, i, attacker, 2)
static Float: originP[3]
pev(i, pev_origin, originP)
originP[0] = (originF[0] - flOrigin[0]) * 10.0
originP[1] = (originP[1] - flOrigin[1]) * 10.0
originP[2] = (originP[2] - flOrigin[2]) + 550.0 - float(distance)
set_pev(i, pev_velocity, originP)
}
}
}
remove_task(entity)
remove_entity(entity)
}
public light(const Float:originF[3]) // Blast ring and small red light around nade from zombie_plague40.sma. Great thx, MeRcyLeZZ!!! ;)
{
// Lighting
engfunc(EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, originF, 0);
write_byte(TE_DLIGHT); // TE id
engfunc(EngFunc_WriteCoord, originF[0]); // x
engfunc(EngFunc_WriteCoord, originF[1]); // y
engfunc(EngFunc_WriteCoord, originF[2]); // z
write_byte(5); // radius
write_byte(128); // r
write_byte(0); // g
write_byte(0); // b
write_byte(51); //life
write_byte(0); //decay rate
message_end();
}
Buscamos lo siguiente.
bueno dentro de eso verán algo como esto:
yo la pondré en la bomba frost
& le agregamos esto:
& gusto en esa misma condición de la bomba frost al final agregan una llave más
quedaria así
luego vamos a
public fw_ThinkGrenade(entity)
& agregamos esto dentro del switch
Código PHP:
public fw_SetModel(entity, const model[])
bueno dentro de eso verán algo como esto:
Código PHP:
else if(model[9] == 'f' && model[10] == 'l' && get_pcvar_num(cvar_frostgrenades))
yo la pondré en la bomba frost
& le agregamos esto:
Código PHP:
if(sz_pipe[pev(entity, pev_owner)])
{
set_rendering(entity, kRenderFxGlowShell, 200, 0, 100, kRenderNormal, 16);
// And a colored trail
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BEAMFOLLOW) // TE id
write_short(entity) // entity
write_short(g_trailSpr) // sprite
write_byte(10) // life
write_byte(10) // width
write_byte(200) // r
write_byte(0) // g
write_byte(0) // b
write_byte(200) // brightness
message_end()
// Set grenade type on the thrown grenade entity
set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_PIPEBOMB)
}
else
{
& gusto en esa misma condición de la bomba frost al final agregan una llave más
quedaria así
Código PHP:
else if(model[9] == 'f' && model[10] == 'l' && get_pcvar_num(cvar_frostgrenades)) // Frost Grenade
{
if(sz_pipe[pev(entity, pev_owner)])
{
set_rendering(entity, kRenderFxGlowShell, 200, 0, 100, kRenderNormal, 16);
// And a colored trail
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BEAMFOLLOW) // TE id
write_short(entity) // entity
write_short(SprTrail) // sprite
write_byte(10) // life
write_byte(10) // width
write_byte(200) // r
write_byte(0) // g
write_byte(0) // b
write_byte(200) // brightness
message_end()
// Set grenade type on the thrown grenade entity
set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_PIPEBOMB)
}
else
{
// Give it a glow
set_rendering(entity, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 16);
// And a colored trail
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BEAMFOLLOW) // TE id
write_short(entity) // entity
write_short(g_trailSpr) // sprite
write_byte(10) // life
write_byte(10) // width
write_byte(0) // r
write_byte(100) // g
write_byte(200) // b
write_byte(200) // brightness
message_end()
// Set grenade type on the thrown grenade entity
set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_FROST)
}// acá agregamos una llave para que no nos de 32222 errores & compile
}
luego vamos a
public fw_ThinkGrenade(entity)
& agregamos esto dentro del switch
Código PHP:
case NADE_TYPE_PIPEBOMB:
{
static owner;
owner = pev(entity, pev_owner);
sz_pipe[owner] = false
set_task(0.1, "hook", entity, _, _, "a", 15);
set_task(1.5, "deleteGren", entity)
new Float:originF[3]
pev(entity, pev_origin, originF);
light(originF)
return HAM_SUPERCEDE;
}
-Sexto
vamos a replace_weapon_models(id, weaponid)
buscan el case de la bomba frost que es la flash
& lo dejan así
Código PHP:
case CSW_FLASHBANG: // Frost grenade
{
if(sz_pipe[id]){
set_pev(id, pev_viewmodel2, g_vmodel)
set_pev(id, pev_weaponmodel2, g_pmodel)
} else
set_pev(id, pev_viewmodel2, model_grenade_frost)
}
EDIT; a la vergaaa tenia muchas cosas que no usaba & las quite cualquier error me dicen o duda así la reparo o lo que sea xd
pd; tengo otras bombas como la aniquiladora, pumpkit, rayo, jump, fire, toxica etc. por si quieren xd