ThunderStorm

• Newbie
• Hello
• Posts: 22
GetForwardPoint help
« on November 13th, 2014, 06:57 AM »
Quote
Code: [Select]
`// [Ka]Juppi's func from http://forum.liberty-unleashed.co.uk/index.php/topic,398.0.html// ported to fit your needsfunction GetForwardPoint( pos, angle ) // you must pass an angle in degrees{ local rad = angle * PI / 180; // we convert to radians                local x = pos.x, y = pos.y; local x2 = x + 1.0 * cos(rad) - 25.0 * sin(rad); // we calculate local y2 = y + 1.0 * sin(rad) + 25.0 * cos(rad);                return Vector( x2, y2, pos.z ); // return a vector}`
Code: [Select]
`local veh = FindPlayer(0).Vehicle; veh.Pos = GetForwardPoint(veh.Pos,veh.EulerAngle.z);`

This didn't work, heads me towards north ( slightly ), in every angle

ysc3839

• VC:MP Beta Tester
• Posts: 622
Re: GetForwardPoint help
« Reply #1, on November 13th, 2014, 10:03 AM »

ThunderStorm

• Newbie
• Hello
• Posts: 22
Re: GetForwardPoint help
« Reply #2, on November 13th, 2014, 10:16 AM »
Quote from ysc3839 on November 13th, 2014, 10:03 AM
Tried, but only works with north and east

ysc3839

• VC:MP Beta Tester
• Posts: 622

ThunderStorm

• Newbie
• Hello
• Posts: 22
Re: GetForwardPoint help
« Reply #4, on November 16th, 2014, 06:57 AM »
Quote from ysc3839 on November 15th, 2014, 03:16 PM
Try veh.Pos,veh.Angle.z ?
Nope