Well i wanted to make the rockets that are swirling around take place in the center, but still have the swirling effect around the rocket that's shot.
if you haven't taken a close look at the swirling death missle, basically there are rockets at the tip of the swirling motion, and basically what i want to do is make the rockets that are around the swirling effect to come in the the middle of the swirling.
basically, when i shoot the death missle, i want it that the rockets take place in the centre of the swirls, but have the swirling effect.
I'm pretty sure i have to change something here; however i never learned CMATH so i'm not sure how to change the location of the rockets, if anyone would show me how i would do this, i would appreciate it alot
Here is the original Bazooka hero
The CMATH link doesn't work on it.
Code:
public SD_CircleRockets(Ent){
new NUMBER_OF_ROCKETS = get_cvar_num("Bazooka_sdcount")
new Float:ROCKET_RADIUS = get_cvar_float("Bazooka_sdradius")
new Float:vOrigin[3]
new Float:vVelocity[3]
new Float:vEntOrig[3]
new Float:RotMatrix[3][3]
new Float:x, Float:y, Float:z, Float:theta
new i, id, NewEnt
if (!is_valid_ent(Ent)) return
Entvars_Get_Vector(Ent, EV_VEC_origin, vOrigin)
Entvars_Get_Vector(Ent, EV_VEC_velocity, vVelocity)
id = Entvars_Get_Edict(Ent, EV_ENT_owner)
RotMatrix[0][0]=vVelocity[0]
RotMatrix[0][1]=vVelocity[1]
RotMatrix[0][2]=vVelocity[2]
RotMatrix[1][0]=-vVelocity[1]
RotMatrix[1][1]=vVelocity[0]
RotMatrix[1][2]=0.0
SD_Normalise(RotMatrix[0])
SD_Normalise(RotMatrix[1])
RotMatrix[2][0]=((RotMatrix[0][1])*(RotMatrix[1][2]))-((RotMatrix[0][2])*(RotMatrix[1][1]))
RotMatrix[2][1]=((RotMatrix[0][2])*(RotMatrix[1][0]))-((RotMatrix[0][0])*(RotMatrix[1][2]))
RotMatrix[2][2]=((RotMatrix[0][0])*(RotMatrix[1][1]))-((RotMatrix[0][1])*(RotMatrix[1][0]))
for (i=0; i < NUMBER_OF_ROCKETS; i++){
theta = (float(i)/float(NUMBER_OF_ROCKETS))*2*PI+fAngleBaz
x = 0.0
#if !defined AMX98
y = floatcos(theta)*ROCKET_RADIUS
z = floatsin(theta)*ROCKET_RADIUS
#else
y = cos(theta)*ROCKET_RADIUS
z = sin(theta)*ROCKET_RADIUS
#endif
vEntOrig[0]=RotMatrix[0][0]*x+RotMatrix[1][0]*y+RotMatrix[2][0]*z
vEntOrig[1]=RotMatrix[0][1]*x+RotMatrix[1][1]*y+RotMatrix[2][1]*z
vEntOrig[2]=RotMatrix[0][2]*x+RotMatrix[1][2]*y+RotMatrix[2][2]*z
vEntOrig[0]+=vOrigin[0]
vEntOrig[1]+=vOrigin[1]
vEntOrig[2]+=vOrigin[2]
NewEnt = SD_CreateRocket(vEntOrig, vVelocity, id)
Entvars_Set_Int(NewEnt, EV_INT_iuser1, Ent)
Entvars_Set_Int(NewEnt, EV_INT_iuser2, i)
}
}
__________________