Jump to content

Spawning ped issue


WhoAmI

Recommended Posts

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
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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...