Hi how to make weaponbox bounces when touched the ground? I don't want to use MOVETYPE_BOUNCE.
Here's the video I've done:
http://youtu.be/bG98sVmGo5Y
Here's the code:
PHP Code:
register_touch("weaponbox", "player", "fw_Touch")
PHP Code:
public fw_Touch(ent, id)
{
new Float:Angle[3], Float:Avelocity[3]
velocity_by_aim(ent, 1000, Angle)
Angle[0] = random_float(-1000.0, 1000.0) //pitch
Angle[1] = random_float(-1000.0, 1000.0) //yaw
Angle[2] = random_float(-1000.0, 1000.0) //roll
Avelocity[0] = random_float(-500.0, 500.0)
Avelocity[1] = random_float(-500.0, 500.0)
Avelocity[2] = random_float(-500.0, 500.0)
entity_set_int(ent, EV_INT_movetype, MOVETYPE_TOSS)
entity_set_vector(ent, EV_VEC_angles, Angle)
entity_set_vector(ent, EV_VEC_avelocity, Avelocity)
entity_set_size(ent, Float:{-16.0, -16.0, 0.0}, Float:{16.0, 16.0, 64.0})
}
__________________