Aun no es un buen tuto xD,a medida q valla aprendiendo yo mismo, voy agregando info.
---------------------------------------------------------------
code by AfteR.
Crear bomba de antidoto dentro del zp.
*1:
Vamos a :
PHP Code:
// pev_ field used to store custom nade types and their values
Tendran algo similar a esto:
PHP Code:
const PEV_NADE_TYPE = pev_flTimeStepSound
const NADE_TYPE_INFECTION = 1111
const NADE_TYPE_NAPALM = 2222
const NADE_TYPE_FROST = 3333
const NADE_TYPE_FLARE = 4444
const PEV_FLARE_COLOR = pev_punchangle
Bueno aqui agregamos la constante de la grenada.
PHP Code:
const NADE_TYPE_ANTIDOTEBOMB = 5555 //si tienen utilizado ese valor pongan orto como 6666.
Y quedaria asi:
PHP Code:
const PEV_NADE_TYPE = pev_flTimeStepSound
const NADE_TYPE_INFECTION = 1111
const NADE_TYPE_NAPALM = 2222
const NADE_TYPE_FROST = 3333
const NADE_TYPE_FLARE = 4444
const NADE_TYPE_ANTIDOTEBOMB = 5555
const PEV_FLARE_COLOR = pev_punchangle
*2
Buscamos el siguiente if:
PHP Code:
else if (equal(model[7], "w_fl", 4
Luego reemplazan todo lo que este abajo del if por esto:
PHP Code:
if(!g_zombie[pev(entity, pev_owner)] && g_antidote_bomb[pev(entity, pev_owner)])
{
fm_set_rendering(entity, kRenderFxGlowShell, 255, 50, 0, kRenderNormal, 16)
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(255) // r
write_byte(128) // g
write_byte(0) // b
write_byte(200) // brightness
message_end()
set_pev(entity, pev_flTimeStepSound, NADE_TYPE_ANTIDOTEBOMB)
}
else
{
// Give it a glow
fm_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)
}
pd:no se olviden de cerrar el "{"
*3
Ahora buscamos esta linea:
PHP Code:
// Check if it's one of our custom nades
Y abajo de case NADE_TYPE_FROST agregan esto:
PHP Code:
case NADE_TYPE_ANTIDOTEBOMB:
{
antidote_explode(entity) // llamamos a la entidad de la antidote bomb
}
Quedaria asi:
PHP Code:
// Check if it's one of our custom nades
switch (pev(entity, PEV_NADE_TYPE))
{
case NADE_TYPE_INFECTION: // Infection Bomb
{
infection_explode(entity)
}
case NADE_TYPE_NAPALM: // Napalm Grenade
{
fire_explode(entity)
}
case NADE_TYPE_FROST: // Frost Grenade
{
frost_explode(entity)
}
case NADE_TYPE_ANTIDOTEBOMB:
{
antidote_explode(entity) // llamamos a la entidad de la antidote bomb
}
*4
Una ves echo eso vamos al final de todo el plugin y agregamos esto:
PHP Code:
// Antidote Bomb
public give_item_antidote_bomb(id)
{
g_antidote_bomb[id] = true // seteamos la variable a true
give_item(id,"weapon_flashbang")
}
public antidote_explode(ent)
{
static Float:originF[3]
pev(ent, pev_origin, originF)
create_blast5(originF)
//engfunc(EngFunc_EmitSound, ent, CHAN_WEAPON, grenade_infect[random_num(0, sizeof grenade_infect - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM)
static attacker
attacker = pev(ent, pev_owner)
g_antidote_bomb[attacker] = false
static victim
victim = -1
while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, originF, RADIUS)) != 0)
{
if (!is_user_alive(victim) || !g_zombie[victim] || g_nemesis[victim] || g_firstzombie[victim] || g_lastzombie[victim])
continue
SendDeathMsg(attacker, victim)
FixDeadAttrib(victim)
UpdateFrags(attacker, victim, get_pcvar_num(cvar_fragsinfect), 1, 1)
humanme(victim, 0)
g_ammopacks[attacker] = g_ammopacks[attacker] + get_pcvar_num(cvar_ammoinfect)
fm_set_user_health(attacker, pev(attacker, pev_health)+get_pcvar_num(cvar_humanbonushp))
}
engfunc(EngFunc_RemoveEntity, ent)
}
public create_blast5(const Float:originF[3])
{
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_BEAMCYLINDER) // TE id
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[2]) // z
engfunc(EngFunc_WriteCoord, originF[0]) // x axis
engfunc(EngFunc_WriteCoord, originF[1]) // y axis
engfunc(EngFunc_WriteCoord, originF[2]+385.0) // z axis
write_short(g_exploSpr) // sprite
write_byte(0) // startframe
write_byte(0) // framerate
write_byte(4) // life
write_byte(60) // width
write_byte(0) // noise
write_byte(255) // red
write_byte(128) // green
write_byte(0) // blue
write_byte(200) // brightness
write_byte(0) // speed
message_end()
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_BEAMCYLINDER) // TE id
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[2]) // z
engfunc(EngFunc_WriteCoord, originF[0]) // x axis
engfunc(EngFunc_WriteCoord, originF[1]) // y axis
engfunc(EngFunc_WriteCoord, originF[2]+470.0) // z axis
write_short(g_exploSpr) // sprite
write_byte(0) // startframe
write_byte(0) // framerate
write_byte(4) // life
write_byte(60) // width
write_byte(0) // noise
write_byte(255) // red
write_byte(164) // green
write_byte(0) // blue
write_byte(200) // brightness
write_byte(0) // speed
message_end()
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_BEAMCYLINDER) // TE id
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[2]) // z
engfunc(EngFunc_WriteCoord, originF[0]) // x axis
engfunc(EngFunc_WriteCoord, originF[1]) // y axis
engfunc(EngFunc_WriteCoord, originF[2]+555.0) // z axis
write_short(g_exploSpr) // sprite
write_byte(0) // startframe
write_byte(0) // framerate
write_byte(4) // life
write_byte(60) // width
write_byte(0) // noise
write_byte(255) // red
write_byte(200) // green
write_byte(0) // blue
write_byte(200) // brightness
write_byte(0) // speed
message_end()
}
*5
Volvemos al comienzo del plugin.
Abajo de los include agregamos esto.
PHP Code:
// antidote bomb
new g_antidote_bomb[33]
new cvar_humanbonushp
new const Float:RADIUS = 240.0
*6
Vamos a:
PHP Code:
public plugin_init()
Y agregamos esto:
PHP Code:
// Antidote Bomb
register_clcmd("antidote_bomb", "give_item_antidote_bomb")
cvar_humanbonushp = register_cvar("zp_antidote_bomb_extra_hp","10")
*7
Luego a:
PHP Code:
public client_disconnect(id)
Agregamos:
PHP Code:
// antidote bomb
g_antidote_bomb[id] = false
*8
esta ves van a:
PHP Code:
public replace_models(id)
Y en el case:
PHP Code:
case CSW_FLASHBANG: // Frost grenade
Reenplazan todo lo q este dentro por:
PHP Code:
if(g_antidote_bomb[id])
set_pev(id, pev_viewmodel2, model_grenade_infect)
else
set_pev(id, pev_viewmodel2, model_grenade_frost)
Quedaria asi:
PHP Code:
case CSW_FLASHBANG: // Frost grenade
{
if(g_antidote_bomb[id])
set_pev(id, pev_viewmodel2, model_grenade_infect)
else
set_pev(id, pev_viewmodel2, model_grenade_frost)
}
*9
Por utlimo van a:
PHP Code:
public event_round_start()
y agregen esto:
PHP Code:
for (new i = 1; i <= g_maxplayers; i++)
{
if (is_user_connected(i))
{
g_antidote_bomb[i] = false
}
}
A compilar y probar!!!
pd:esto va mas dedicado a los q no le funca el plugin de la antidote bomb,como me paso ami xD