[en]
Hello good evening. My help is, I want the box to be in place when it is released and it only moves up and down again, always fulfilling the movement until it is picked up. Thanks!
[es]
Hola, buenas noches. Mi ayuda es, quiero que la caja al soltarla que este en el lugar y solamente se mueva hacia arriba y vuelva a bajar, siempre cumpliendo el movimiento hasta que sea recogida. Gracias!
PHP Code:
public dropear(id) {
if(!is_user_alive(id)) return PLUGIN_HANDLED
if(g_regalitos >= get_pcvar_num(cvar_limite)) {
set_hudmessage(255, 0, 0, 0.0, 0.80, 1, 6.0, 12.0)
show_hudmessage(id, "Limite de regalitos alcanzado")
return PLUGIN_HANDLED
}
if(can_pickup[id] != false) {
can_pickup[id] = false
set_task(0.1, "reset_pick", id)
new Float:Speed[3]
velocity_by_aim(id, 0 * 0, Speed)
dropear2(id, Speed)
g_regalitos++
set_hudmessage(0, 255, 0, 0.0, 0.80, 1, 6.0, 12.0)
show_hudmessage(id, "Regalitos en mapa: %d", g_regalitos)
}
return PLUGIN_HANDLED
}
public dropear2(id, Float:Speed[]) {
new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
new Float:origin[3]
pev(id, pev_origin, origin)
set_pev(ent, pev_origin, origin)
Speed[2] += 100.0
set_pev(ent, pev_velocity, Speed)
new Float:angles[3]
pev(ent, pev_angles,angles)
angles[1] += random_num(1,360)
set_pev(ent, pev_angles, angles)
set_pev(ent, pev_classname, "regalitos_volando")
engfunc(EngFunc_SetModel, ent, MDL)
engfunc(EngFunc_SetSize, ent, Float:{-0.00, -0.33, -100.0}, Float:{0.00, 0.33, 100.0})
set_pev(ent, pev_solid, SOLID_TRIGGER)
set_pev(ent, pev_movetype, MOVETYPE_NOCLIP)
engfunc(EngFunc_DropToFloor, ent)
colores(ent)
}