DarkLink Posted July 7, 2011 Share Posted July 7, 2011 Okay I am having a problem here with rotation of peds I have this on my map file: <spawnpoint id="buyer" skin="0" posX="-545.63269042969" posY="2577.0908203125" posZ="53.515625" rotX="0" rotY="0" rotZ="262" /> And now I want to create a ped on that position and with that rotation. So I made this on Lua: local buyer = getElementByID("buyer") local x,y,z = getElementPosition(buyer) local rot1, rot2, rot3 = getElementRotation(buyer) local buyerPed = createPed(14, x, y, z, rot1) I notice on the page https://wiki.multitheftauto.com/wiki/GetElementRotation, about the default order of rotation. and it says that retuns like Z,Y,X, so thats why I put rot1 on createPed function, anyway I tryed with rot2 and rot3 and it doesnt set the rotation.. Can someone help me here? Thanks!! Link to comment
Remi-X Posted July 7, 2011 Share Posted July 7, 2011 Set is correct, get according to the wiki not (I can't confirm this, as I never experienced the problem ) So, for the rotation parameters: '0, 0, rot1' should be correct in that case. BUT, does getElement...() actually work on map files? I never tried this, so could anyone confirm this? Link to comment
DarkLink Posted July 7, 2011 Author Share Posted July 7, 2011 Set is correct, get according to the wiki not (I can't confirm this, as I never experienced the problem ) So, for the rotation parameters: '0, 0, rot1' should be correct in that case.BUT, does getElement...() actually work on map files? I never tried this, so could anyone confirm this? yes it works, I manage to do many things with map files.. getting position of spawn .. get position of objects. but I am having problem with rotation Thanks for your help Link to comment
Buffalo Posted July 7, 2011 Share Posted July 7, 2011 In the worst case try getElementData(element,'rotZ') Link to comment
Remi-X Posted July 7, 2011 Share Posted July 7, 2011 Oh, funny I always used get-attributes functions. But did you try what I said? My rotations always work, though they're retrieved another way. createPed ( 14, x, y, z, 0, 0, rot1 ) If rot1 doesnt work properly, use rot3. Idk what getElementRotation does on map elements. Link to comment
DarkLink Posted July 7, 2011 Author Share Posted July 7, 2011 In the worst case try getElementData(element,'rotZ') Thanks buffalo, but still not working... This is weird, its a simple thing And still not working .. bah :c Link to comment
DarkLink Posted July 7, 2011 Author Share Posted July 7, 2011 Oh, funny I always used get-attributes functions. But did you try what I said? My rotations always work, though they're retrieved another way. createPed ( 14, x, y, z, 0, 0, rot1 ) If rot1 doesnt work properly, use rot3. Idk what getElementRotation does on map elements. Thanks for your help, but the function createPed only receives on rot coord. Its on wiki : createPed ( int modelid, float x, float y, float z [, float rot = 0.0 ] ) And I tryed what u said before, but didnt work too Link to comment
DarkLink Posted July 7, 2011 Author Share Posted July 7, 2011 (edited) Guys I forgot the .map file, and tryed just doing this: local buyerPed = createPed(14, -545.63269042969, 2577.0908203125, 53.515625, 0) on the second try: local buyerPed = createPed(14, -545.63269042969, 2577.0908203125, 53.515625, 120) on the third try: local buyerPed = createPed(14, -545.63269042969, 2577.0908203125, 53.515625, 200) And the ped keeps looking at the same point!! God dammn it ! lol Thanks in advance EDDIIIT: I tryed using setPedRotation ( ped thePed, float rotation ) and it works now!! But when I try to set the rotation on the createPed function it doesnt work is there some bug with this? if yes, can someone report to the mta team? I dont know how to do it. Thanks!! Edited July 7, 2011 by Guest Link to comment
DarkLink Posted July 7, 2011 Author Share Posted July 7, 2011 Did you try setPedRotation? Tryed now it works, look at my edit on reply before Is there some bug with rotation on createPed? it suppose to set rotation also on createPed function Link to comment
Buffalo Posted July 7, 2011 Share Posted July 7, 2011 (edited) I think setting rotation instantly works only from 1.1, as it doesn't work on 1.0 for me too. Edited July 7, 2011 by Guest Link to comment
DarkLink Posted July 7, 2011 Author Share Posted July 7, 2011 I think setting rotation instantly is only from 1.1, as it doesn't work on 1.0 for me too. Hm okay thanks for the advice buffalo Link to comment
Remi-X Posted July 7, 2011 Share Posted July 7, 2011 Right, I see. http://bugs.mtasa.com/view.php?id=5717 Link to comment
DarkLink Posted July 7, 2011 Author Share Posted July 7, 2011 Right, I see.http://bugs.mtasa.com/view.php?id=5717 Ye nice, you found it Thanks bro! Link to comment
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