Jump to content

mySQL don't update


ahmedo01

Recommended Posts

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

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