dzek (varez) Posted November 14, 2010 Posted November 14, 2010 hi, im looking for way to get a point like 10units before my car. i get function do to this- but it ignores Z position. i need to make it work with any rotation. function: function getPositionRelatedToVehicle(theVeh, val) local xx, yy, zz = getElementPosition(theVeh) local rx, ry, rot = getElementRotation(theVeh) local lx = xx + math.sin (math.rad(-rot)) * val local ly = yy + math.cos (math.rad(-rot)) * val return lx,ly end Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
Aibo Posted November 14, 2010 Posted November 14, 2010 i second that request. have the same issue in my "omg" resource (need to correctly attach an object to main object if main is rotated by any axis, currently only Z rotation is fine). it's not that i have no idea how to do this, in fact i do. but all these matrix calculations, euler angles and other math stuff are making my brain hurt. and i'm not even a programmer, im a designer. :3 ?
dzek (varez) Posted November 14, 2010 Author Posted November 14, 2010 hell, i though you replied i was thinking about attaching an object (like invisible corona) to car - and get pos of corona - much simpler, as the offset X, Y, Z while attaching are including source rotation. but i would like more to make it via pure scripting. Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
AdiBoy Posted November 14, 2010 Posted November 14, 2010 here: https://wiki.multitheftauto.com/wiki/Get ... ceRotation
dzek (varez) Posted November 14, 2010 Author Posted November 14, 2010 i know about this, lol i'm not the guy that can't check the wiki before asking. this function about is for something totally different, and it's returning X and Y only too. Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
Wojak Posted November 15, 2010 Posted November 15, 2010 and wtat is wrong with this: https://wiki.multitheftauto.com/wiki/GetElementMatrix ? create your teleports and interiors in MTA map editor want more excitment in your race map? - add a killer bot you may also add some peds (NPC) - CARMAGEDDON STYLE! 2paq MTA:SA Race Server
eAi Posted November 15, 2010 Posted November 15, 2010 The example on https://wiki.multitheftauto.com/wiki/GetElementMatrix looks like it does what you want to me?
greacius Posted November 17, 2010 Posted November 17, 2010 viewtopic.php?f=91&t=24355&p=289767&hilit=Pickup+in+Front+of+player#p289767 maybe this is what you are looking for? http://AllesOverServers.nl http://www.zakelijkthuis.nl/promoot.php?x=4179
dzek (varez) Posted November 17, 2010 Author Posted November 17, 2010 i'll try all these solutions when i'll find some free time, thanks, ill post the result Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now