Post by smerick on Feb 4, 2015 16:32:04 GMT
good to all people on the forum, how I can add a function to burn that takes 200 dmg for 5 seconds when touch the forcefield
beforehand thanks for reading it.
the code that use force field is this:
beforehand thanks for reading it.
the code that use force field is this:
// in public fw_ThinkGrenade(entity)
case NADE_TYPE_CAMPO: // force shield
{
static duration
duration = pev(entity, PEV_FLARE_DURATION)
new ran_color; ran_color = random_num(0, MAX_COLORES-1)
if (duration > 0)
{
if (duration == 1)
{
engfunc(EngFunc_RemoveEntity, entity)
return HAM_SUPERCEDE;
}
set_pev(entity, PEV_FLARE_DURATION, --duration)
set_pev(entity, pev_dmgtime, current_time + 5.0)
}
else if ((pev(entity, pev_flags) & FL_ONGROUND) && fm_get_speed(entity) < 10)
{
engfunc(EngFunc_SetModel, entity, model_force_camp)
fm_set_rendering(entity, kRenderFxGlowShell, ColoresCampo[ran_color][Red], ColoresCampo[ran_color][Green], ColoresCampo[ran_color][Blue], kRenderTransAlpha, 32)
set_pev(entity, PEV_FLARE_DURATION, 1 + 15 / 5)
set_pev(entity, pev_dmgtime, current_time + 0.1)
set_pev(entity, pev_nextthink, get_gametime() + 0.1)
}
else
{
set_pev(entity, pev_dmgtime, current_time + 0.5)
}
}
// end zp
public fw_think_bubble(entity)
{
if (!pev_valid(entity)) return;
static model[64];
pev(entity, pev_model, model, charsmax(model))
if (equal(model, model_force_camp))
{
static e = -1
new Float:centerF[3], Float:originF[3], Float:directionF[3], Float:proporcionF
pev(entity, pev_origin, centerF)
while ((e = engfunc(EngFunc_FindEntityInSphere, e, centerF, 100.0)) != 0)
{
// Si no es un player o no es zombie, el campo de fuerza lo ignorará
if((e > g_maxplayers) || !g_zombie[e] || g_nemesis[e] || g_assassin[e])
continue;
pev(e, pev_origin, originF)
// Direccion
xs_vec_sub(originF, centerF, directionF)
proporcionF = ((150.0 + 40.0) - vector_length(directionF)) / 10.0
xs_vec_mul_scalar(directionF, proporcionF, directionF)
set_pev(e, pev_velocity, directionF)
}
set_pev(entity, pev_nextthink, get_gametime() + 0.1)
}
}