ahmedo01 Posted November 9, 2014 Share Posted November 9, 2014 addEventHandler( "onClientPlayerQuit", getRootElement(), function( reason ) local account = getPlayerAccount( source ) local money = getPlayerMoney( source ) local occupation = getElementData( source, "Occupation") local team = getPlayerTeam( source ) local teamname = getTeamName( team ) local x,y,z = getElementPosition( source ) local dimension = getElementDimension( source ) local interior = getElementInterior( source ) local skin = getElementModel( source ) local accountname = getAccountName( account ) if money and occupation and team and x and y and z and dimension and interior and skin and teamname then local savelocation = mysql_query(moduledb, "UPDATE 'playerlocations' SET x = '"..x.."', y = '"..y.."', z = '"..z.."' WHERE accountname = '"..accountname.."'") local saveothers = mysql_query(moduledb, "UPDATE 'playerinfo' SET money = '"..money.."', occupation = '"..occupation.."', team = '"..teamname.."', dimension = '"..dimension.."', interior = '"..interior.."', skin = '"..skin.."' WHERE accountname = '"..accountname.."'") --mysql_free_result(savelocation) --mysql_free_result(saveothers) else outputChatBox("Error! Cannot save informations!") end end ) don't update. i am using mta_mysql module Link to comment
DiSaMe Posted November 9, 2014 Share Posted November 9, 2014 Server doesn't have such event like "onClientPlayerQuit". Use "onPlayerQuit". Link to comment
ahmedo01 Posted November 9, 2014 Author Share Posted November 9, 2014 i used already but it gives error. Link to comment
DiSaMe Posted November 9, 2014 Share Posted November 9, 2014 So if it gives an error, that probably means at least the function is executed. Link to comment
ahmedo01 Posted November 9, 2014 Author Share Posted November 9, 2014 i know. but i cant fix. Link to comment
joaosilva099 Posted November 9, 2014 Share Posted November 9, 2014 Tell us exactly what/where error is... Link to comment
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