WhoAmI Posted April 11, 2015 Share Posted April 11, 2015 Hello. I have very, veryw weird problem. I'm using this code createPed ( skins[characterList[id]["sex"]][1], 1727.98, -1632.4, 20.2 ); Of couse 'skins[characterList[id]["sex"]][1]' returns good value. Ped is created, but in different position. I'm sure that xyz is correct. I have even made camera looking at this xyz and it looks in good place, but ped still is created in different position. Can someone explain me what's the problem? Code is clientside. Link to comment
Mr.unpredictable. Posted April 11, 2015 Share Posted April 11, 2015 setPedRotation Edit Sorry you meant position. Link to comment
WhoAmI Posted April 11, 2015 Author Share Posted April 11, 2015 What can I do with that function? Ped is spawning in completely different position. Link to comment
Mr.unpredictable. Posted April 11, 2015 Share Posted April 11, 2015 addEventHandler("onResourceStart",resourceRoot,function() createPed ( 45, 1727.98, -1632.4, 20.2 ) end) It's working fine for me, My code is in server side. Link to comment
WhoAmI Posted April 11, 2015 Author Share Posted April 11, 2015 I need to create it clientside. Link to comment
Mr.unpredictable. Posted April 11, 2015 Share Posted April 11, 2015 It's working fine for me in client side also. http://i.imgur.com/UVbeSYZ.jpg Link to comment
WhoAmI Posted April 11, 2015 Author Share Posted April 11, 2015 It's kinda strange, because i'm checking what the position of ped is, and it returns me correct xyz. What's more I still can't see the ped on this position. Link to comment
WhoAmI Posted April 11, 2015 Author Share Posted April 11, 2015 addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) local ped = createPed ( 0, 1727.98, -1632.4, 20.2 ); ped:setID ( "s-ped" ); end ); [lua]local xxx, yyy, zzz = getElementPosition ( ped ); outputChatBox ( xxx .. ", " .. yyy .. ", " .. zzz ); Output 1727.9799804688, -1632.4000244141, 20.200000762939 http://i.snag.gy/xAQ3l.jpg Link to comment
Mr.unpredictable. Posted April 11, 2015 Share Posted April 11, 2015 addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) local ped = createPed ( 0, 1727.98, -1632.4, 20.2 ); ped:setID ( "s-ped" ); end ); [lua]local xxx, yyy, zzz = getElementPosition ( ped ); outputChatBox ( xxx .. ", " .. yyy .. ", " .. zzz ); Output 1727.9799804688, -1632.4000244141, 20.200000762939 http://i.snag.gy/xAQ3l.jpg working fine for me. http://i.imgur.com/8NIuIk2.jpg Link to comment
WhoAmI Posted April 11, 2015 Author Share Posted April 11, 2015 Yea I know. Dunno why it doesn't work for me. Something changing. ped's position. Link to comment
WhoAmI Posted April 11, 2015 Author Share Posted April 11, 2015 I fixed it somehow. Don't ask me how, because I don't really know. 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