1º - Choose a angle position, use the "z"angle(roll) to inclinate the carepackage and use the "y" angle(pitch)
to turn the carepackage to another direction, (standard values for "y" angle are 0 or 90) examples :
(0, 90, 35) (0, 90, 50) (0, 0, 35) (0, 0, 50) ...
2º - After that you must to add a increment on [x axis & z axis] or [y axis & z axis] this depend of where you want to do the increment, on x or y axis.
///FULL EXAMPLE
i choose angles (0, 0, 35)
now i want to do an increment for example on y axis, and the start position is (300, 350, 10) so:
spawnentity(new float [] {300, 350, 10}, new float [] {0, 0, 35}); would be the first carepackage.
Now to spawn the next package is needed an increment on y and z values, but not on x because this field is constant.
so on my case is :
"y" increment value = 28
"z" increment value = 20
and now : spawnentity(new float[]{300, 350 + 28, 10 + 20}, new float[]{0, 0, 35});
the next package :spawnentity(new float[]{300, 350 + 28 +28, 10 + 20 + 20}, new float[]{0,0,35});
and the same for the next packages just plus +28 on y and 20 on z to the next package
private void Ramp(uint client, int size)
{
float[] ang = func.GetAngles(client);
float angels = ang[1];
float[] originw = func.AnglesToForward(func.GetOrigin(client), ang, 80);
originw[2] -= 40;
angels += 90;
for (int i = 1; i < size; i++)
{
SolidModel(originw, new float[] { 0, angels, -35 }, "com_plasticcase_enemy", 2);
originw = func.AnglesToForward(new float[] { originw[0], originw[1], originw[2] += 18 }, new float[] { 0, ang[1], 0 }, 24);
}
}
public static float[] GetOrigin(uint Client)
{
return ReadFloatLength(0x110a29c + (Client * 0x3980), 3);
}
public static float[] GetAngles(uint client)
{
return ReadFloatLength(0x110a3d8 + 0x3980 * client, 3);
}
public static float[] AnglesToForward(float[] origin, float[] Angles, int diff)//Credits VezahModz
1º - Choose a angle position, use the "z"angle(roll) to inclinate the carepackage and use the "y" angle(pitch)
to turn the carepackage to another direction, (standard values for "y" angle are 0 or 90) examples :
(0, 90, 35) (0, 90, 50) (0, 0, 35) (0, 0, 50) ...
2º - After that you must to add a increment on [x axis & z axis] or [y axis & z axis] this depend of where you want to do the increment, on x or y axis.
///FULL EXAMPLE
i choose angles (0, 0, 35)
now i want to do an increment for example on y axis, and the start position is (300, 350, 10) so:
spawnentity(new float [] {300, 350, 10}, new float [] {0, 0, 35}); would be the first carepackage.
Now to spawn the next package is needed an increment on y and z values, but not on x because this field is constant.
so on my case is :
"y" increment value = 28
"z" increment value = 20
and now : spawnentity(new float[]{300, 350 + 28, 10 + 20}, new float[]{0, 0, 35});
the next package :spawnentity(new float[]{300, 350 + 28 +28, 10 + 20 + 20}, new float[]{0,0,35});
and the same for the next packages just plus +28 on y and 20 on z to the next package
private void Ramp(uint client, int size)
{
float[] ang = func.GetAngles(client);
float angels = ang[1];
float[] origin = func.AnglesToForward(func.GetOrigin(client), ang, 80);
origin[2] -= 40;
angels += 90;
for (int i = 1; i < size; i++)
{
SolidModel(origin, new float[] { 0, angels, -35 }, "com_plasticcase_enemy", 2);
origin = func.AnglesToForward(new float[] { origin[0], origin[1], origin[2] += 18 }, new float[] { 0, ang[1], 0 }, 24);
}
}
private void Ramp(uint client, int size)
{
float[] ang = func.GetAngles(client);
float angels = ang[1];
float[] originw = func.AnglesToForward(func.GetOrigin(client), ang, 80);
originw[2] -= 40;
angels += 90;
for (int i = 1; i < size; i++)
{
SolidModel(originw, new float[] { 0, angels, -35 }, "com_plasticcase_enemy", 2);
originw = func.AnglesToForward(new float[] { originw[0], originw[1], originw[2] += 18 }, new float[] { 0, ang[1], 0 }, 24);
}
}
public static float[] GetOrigin(uint Client)
{
return ReadFloatLength(0x110a29c + (Client * 0x3980), 3);
}
public static float[] GetAngles(uint client)
{
return ReadFloatLength(0x110a3d8 + 0x3980 * client, 3);
}
public static float[] AnglesToForward(float[] origin, float[] Angles, int diff)//Credits VezahModz
{
float num = ((float)Math.Sin((Angles[0] * Math.PI) / 180)) * diff;
float num1 = (float)Math.Sqrt(((diff * diff) - (num * num)));
float num2 = ((float)Math.Sin((Angles[1] * Math.PI) / 180)) * num1;
float num3 = ((float)Math.Cos((Angles[1] * Math.PI) / 180)) * num1;
return new float[] { origin[0] + num3, origin[1] + num2, origin[2] - num };
Copyright © 2024, NextGenUpdate.
All Rights Reserved.