look at the soccerjum plugin it does waht you say when you curve the ball
PHP Code:
public CurveBall(id) {
if(direction && get_speed(aball) > 5 && curvecount > 0) {
new Float:dAmt = float((direction * CURVE_ANGLE) / ANGLEDIVIDE);
new Float:v[3], Float:v_forward[3];
entity_get_vector(aball, EV_VEC_velocity, v);
vector_to_angle(v, BallSpinDirection);
BallSpinDirection[1] = normalize( BallSpinDirection[1] + dAmt );
BallSpinDirection[2] = 0.0;
angle_vector(BallSpinDirection, 1, v_forward);
new Float:speed = vector_length(v)// * 0.95;
v[0] = v_forward[0] * speed
v[1] = v_forward[1] * speed
entity_set_vector(aball, EV_VEC_velocity, v);
curvecount--;
set_task(CURVE_TIME, "CurveBall", id);
}
}
https://forums.alliedmods.net/showthread.php?t=41447
__________________