WhoAmI Posted April 11, 2015 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.
Mr.unpredictable. Posted April 11, 2015 Posted April 11, 2015 setPedRotation Edit Sorry you meant position.
WhoAmI Posted April 11, 2015 Author Posted April 11, 2015 What can I do with that function? Ped is spawning in completely different position.
Mr.unpredictable. Posted April 11, 2015 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.
Mr.unpredictable. Posted April 11, 2015 Posted April 11, 2015 It's working fine for me in client side also. http://i.imgur.com/UVbeSYZ.jpg
WhoAmI Posted April 11, 2015 Author 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.
WhoAmI Posted April 11, 2015 Author 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
Mr.unpredictable. Posted April 11, 2015 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
WhoAmI Posted April 11, 2015 Author Posted April 11, 2015 Yea I know. Dunno why it doesn't work for me. Something changing. ped's position.
WhoAmI Posted April 11, 2015 Author Posted April 11, 2015 I fixed it somehow. Don't ask me how, because I don't really know.
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