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?