executeSQLSelect returns 2-dimensional table. You are using 1-dimensional table.
So try this one:
function create_tables()
executeSQLCreateTable ( "users", "user STRING, health INT, armor FLOAT, money INT, x FLOAT, y FLOAT, z FLOAT, wanted INT, skin INT, dim INT, int INT, r INT, g INT, b INT, jailtime INT" )
end
addEventHandler("onResourceStart",resourceRoot,create_tables)
function save_general()
local health = getElementHealth(source)
local Armor = getPedArmor(source)
local money = getPlayerMoney(source)
local x,y,z = getElementPosition(source)
local wanted = getPlayerWantedLevel(source)
local skin = getElementModel(source)
local dim = getElementDimension (source)
local int = getElementInterior (source)
local r, g, b = getPlayerNametagColor ( source )
local playername = getPlayerName ( source )
local jailtime = getElementData(source,"jailtime")
executeSQLUpdate( "users", "user = '" .. getAccountName( getPlayerAccount( source ) ) .. "', health = '" .. health .. "', armor = '" .. armor .. "', money = '" .. money .. "', x = '" .. x .. "', y = '"..y.."'z = '" .. z .."',wanted = '".. wanted .."',skin = '".. skin .."',dim = '".. dim .. "',int = '".. int .."',r = '".. r .. "',g = '".. g .."',b = '".. b .. "',jailtime = '".. jailtime .."'")
end
addEventHandler("onPlayerQuit",root,save_general)
function save_setData()
local userTable = executeSQLSelect ( "users", "user","user = '" .. getAccountName( getPlayerAccount( source ) ) .. "'", "health", "armor", "money", "x", "y", "z", "wanted","skin","dim","int","r","g","b","jailtime" )
setElementHealth(source,userTable[1][3])
setPedArmor(source,userTable[1][4])
setPlayerMoney(source,userTable[1][5])
setElementPosition( source, userTable[1][6], userTable[1][7], userTable[1][8] )
setPlayerWantedLevel(source,userTable[1][9])
setElementModel(source,userTable[1][10])
setElementDimension (source,userTable[1][11])
setElementInterior (source,userTable[1][12])
setPlayerNametagColor ( source, userTable[1][13], userTable[1][14], userTable[1][15] )
setElementData(source,"jailtime",userTable[1][16)
end
addEventHandler( "onPlayerLogin", root, save_setData )