Jump to content

onPlayerQuit


WhoAmI

Recommended Posts

Hello there, I have problem

I have such a code

  
addEventHandler ( "onPlayerQuit", root, function () 
    if getElementData ( source, "imie" ) then 
        uid = tonumber ( getElementData ( source, "uid" ) ) 
        local x,y,z = getElementPosition ( source ) 
        local cash = getPlayerMoney ( source ) 
        local skin = getElementModel ( source ) 
        local hp = getElementHealth ( source ) 
        outputDebugString ( skin .. hp ) 
        dbExec ( db, "UPDATE Postacie SET portfel = '?', x = ?, y = ?, z = ?, skin = '?', hp = '?' WHERE uid = '?'", tonumber(cash), x, y, z, tonumber(skin), hp, uid ) 
    end 
end) 
  

And the 'skin' and 'hp' output '0' and it saves so in database. When I spawn again I'm dead. Is it problem in my code or it is only bug of this event?

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