Post: How To Build Ramps C++/C#
01-28-2016, 10:26 PM #1
CrEaTiiOn_420
Can’t trickshot me!
(adsbygoogle = window.adsbygoogle || []).push({}); This is how to build ramps on MW3 in C++/C# Tutorial

    

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 :P




here this will make a ramp in front of you no matter what way your facing


Thanks To jwm614
    
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
Last edited by CrEaTiiOn_420 ; 01-29-2016 at 04:40 AM.
01-29-2016, 12:56 AM #2
jwm614
NextGenUpdate Elite
Originally posted by 420 View Post
This is how to build ramps on MW3 in C++/C# Tutorial

    

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 :P




here this will make a ramp in front of you no matter what way your facing
if you need the function for origin angles angf let me kno

    

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);
}
}
Last edited by jwm614 ; 01-29-2016 at 01:36 AM.
01-29-2016, 01:15 AM #3
CrEaTiiOn_420
Can’t trickshot me!
Originally posted by jwm614 View Post
here this will make a ramp in front of you no matter what way your facing
if you need the function for origin angles angf let me kno

    

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);
}
}


thanks man ill update the thread with this code if that alright with you and this thread is mostly explaining how to set everything up and so people can understand how to work with it Winky Winky thanks again man
01-29-2016, 01:34 AM #4
jwm614
NextGenUpdate Elite
Originally posted by 420 View Post
thanks man ill update the thread with this code if that alright with you and this thread is mostly explaining how to set everything up and so people can understand how to work with it Winky Winky thanks again man


np here is the functions needed
you can use the spawnentity you have

    
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.

Gray NextGenUpdate Logo