hola a todos.... bueno tengo 2 problemitas y una vez resueltos termino mi zp Beta
el primero es con la granada de hielo, le saque en la parte de // Victim shouldn't take damage or victim is frozen para que cada vez que congele a un zombie pueda recibir daņo, no me funciono
PHP Code:
// Ham Take Damage Forward (inflictor = weapon)
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
// Non-player damage or self damage
if (victim == attacker || !is_user_connected(attacker))
return HAM_IGNORED;
// New round starting or round ended
if (g_newround || g_endround)
return HAM_SUPERCEDE;
// Victim shouldn't take damage or victim is frozen
if (g_nodamage[victim]) // aca el tuto me decia que tenia que borrar "|| g_frozen[victim]" no paso nada
return HAM_SUPERCEDE;
// Prevent friendly fire
if (g_zombie[attacker] == g_zombie[victim])
return HAM_SUPERCEDE;
// Attacker is human...
if (!g_zombie[attacker])
{
// Wesker damage x3
if (g_wesker[attacker] || get_user_weapon(attacker) == CSW_DEAGLE && g_weskerdeagle[attacker])
{
if (g_nemesis[victim])
SetHamParamFloat(4, damage * 3)
else
SetHamParamFloat(4, damage * 3)
}
// Reward ammo packs
if (!g_survivor[attacker] || !g_sniper[attacker] || !g_l4d[attacker] || !g_depredador[attacker] || !g_wesker[attacker] && !get_pcvar_num(cvar_survignoreammo))
{
// Store damage dealt
g_damagedealt[attacker] += floatround(damage)
// Get damage required to get an ammo pack
static ammodamage
ammodamage = get_pcvar_num(cvar_ammodamage)
// Reward ammo packs for every [ammo damage] dealt
while (g_damagedealt[attacker] >= (ammodamage / (g_happytime + 1)) )
{
g_ammopacks[attacker]++
g_ammopacks[attacker]++
g_damagedealt[attacker] -= ammodamage
}
}
// Replace damage done by Sniper's weapon with the one set by the cvar
if (g_sniper[attacker] && g_currentweapon[attacker] == CSW_AWP)
SetHamParamFloat(4, get_pcvar_float(cvar_sniperdamage))
return HAM_IGNORED;
}
// Attacker is zombie...
// Prevent infection by HE grenade (bugfix)
if (damage_type & DMG_HEGRENADE)
return HAM_SUPERCEDE;
// Nemesis?
if (g_nemesis[attacker] || g_assassin[attacker] || g_alien[attacker])
{
// Set nemesis damage
SetHamParamFloat(4, get_pcvar_float(cvar_nemdamage))
return HAM_IGNORED;
}
// Last human or swarm round or plague round
if (g_swarmround || g_plagueround || g_nemround || g_assassinround || g_alienround || g_mutacionround || fnGetHumans() == 1)
return HAM_IGNORED; // human is killed
// Does human armor need to be reduced before infecting?
if (get_pcvar_num(cvar_humanarmor))
{
// Get victim armor
static Float:armor
pev(victim, pev_armorvalue, armor)
// Block the attack if he has some
if (armor > 0.0)
{
engfunc(EngFunc_EmitSound, victim, CHAN_BODY, sound_armorhit, 1.0, ATTN_NORM, 0, PITCH_NORM)
set_pev(victim, pev_armorvalue, floatmax(0.0, armor - damage))
return HAM_SUPERCEDE;
}
}
// Infection allowed
SendDeathMsg(attacker, victim) // send death notice
FixDeadAttrib(victim) // fix the "dead" attrib on scoreboard
UpdateFrags(attacker, victim, get_pcvar_num(cvar_fragsinfect), 1, 1) // add corresponding frags and deaths
zombieme(victim, attacker, 0, 0) // turn into zombie
g_ammopacks[attacker] += get_pcvar_num(cvar_ammoinfect) // ammo packs given to zombie for infection
fm_set_user_health(attacker, pev(attacker, pev_health)+get_pcvar_num(cvar_zombiebonushp)) // attacker gets bonus HP for the infection
return HAM_SUPERCEDE;
}
el segundo es con el campo.... quiero que el nemesis lo atraviese junto otras clases de otros modos...
le saque en la parte de la public entity_touch(touched, toucher) el g_nemesis[toucher] tampoco me funciono, es del tuto de Fail! la granada de campo..
PHP Code:
// Touch bomb bubble
public entity_touch(touched, toucher) // entidad cuando un zombie o nemesis la toca
{
if(g_zombie[toucher]) // aca le saque la del neme || g_nemesis[toucher]
{
new Float:pos_ptr[3], Float:pos_ptd[3], Float:push_power = get_pcvar_float(cvar_bubblepush) // intensidad de rechazo
pev(touched, pev_origin, pos_ptr) // nose que es
pev(toucher, pev_origin, pos_ptd) // nose que es
for(new i = 0; i < 3; i++)
{
pos_ptd[i] -= pos_ptr[i] // nose que es
pos_ptd[i] *= push_power // poder cuando lo tocamos y nos rechaza
}
set_pev(toucher, pev_velocity, pos_ptd) // velocidad del rechazo
set_pev(toucher, pev_impulse, pos_ptd) // impulso del rechazo
}
}
// Hook bubble bomb
public hook_curwpn(id)
{
if(!is_user_alive(id)) // cliente muerto no recibe =D
return PLUGIN_CONTINUE;
if(g_bubble_bomb[id] && !g_zombie[id]) // la bomba solo la puede adquirir un humano
{
new wID = read_data(2)
if(wID == CSW_SMOKEGRENADE) // toma el lugar de la smoke grenade
set_pev(id, pev_viewmodel2, model_grenade) // modelo de la grana
}
return PLUGIN_CONTINUE;
}
// Give bubble item / hacemos que nos de el campo
public give_item_bubble(id)
{
g_bubble_bomb[id] = true // seteamos la variable a true
fm_give_item(id,"weapon_smokegrenade") // le pedimos una smoke ya que el campo la remplaza
}
// Remove Entity / removemos la entidad con el task
public DeleteEntity(entity)
{
if(is_valid_ent(entity )) // hacemos valida la entidad
remove_entity(entity) // la removemos...
}
saludos....
_____________________________________________ ___
Gracias Allied Modders
Video: Menu de Granadas, Efectos, Lanza Granadas
http://www.youtube.com/watch?v=2RmAOPBGvuM