Jump to content

Problem with saving position


BlackFan

Recommended Posts

Hello, guys. Please, help me someone. I have a problem with saving position. When a player goes out and comes on the server - it appears in the textures. For example, when he goes out of his position: 1984.54655813, 256.4845612, 12.152644, but when comes: 1984, 256, 12.

Link to comment

Why dont you just add 1 point to the Z-index from the saved data, or add 1 point to the account?

addEventHandler("onPlayerQuit", root, 
    function ( source ) 
        local account = getPlayerAcocunt ( source ); 
        if ( acount ) then 
            local x, y, z = getElementPosition ( source ); 
            setAccountData ( account, "Pos-X", x ); 
            setAccountData ( account, "Pos-Y", y ); 
            setAccountData ( account, "Pos-Z", z + 1 ); 
        end 
    end 
); 

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