LOOK AT 3rd Post
function addPlayer()
local playeraccount = getPlayerAccount(source)
if not isGuestAccount(playeraccount) then
local accountname = getAccountName(playeraccount)
CheckPlayer = executeSQLSelect ( "PlayersData", "accountname", "accountname = '" .. accountname .. "'" )
if ( type( CheckPlayer ) == "table" and #CheckPlayer == 0 ) or not CheckPlayer then
executeSQLInsert ( "PlayersData", "'".. accountname .."','0','0','0','0','FF0000','00FF00','None','None/None','I love DMC','0','0'" )
end
end
local playeraccount = getPlayerAccount(source)
if not isGuestAccount(playeraccount) then
local accountname = getAccountName(playeraccount)
local data = executeSQLQuery("SELECT * FROM PlayersData where accountname = '" .. accountname .. "'")
outputChatBox(getPlayerName(source).. " login and says: ".. data[1]["LoginMsg"] .."!",root,0,255,0,true)
setElementData(source,"ageNsex",data[1]["AgeNSex"])
setElementData(source,"contact",data[1]["Contact"])
setElementData(source,"message",data[1]["LoginMsg"])
setElementData(source,"skin",data[1]["Skin"])
setElementData(source,"NC",data[1]["NameC"])
setElementData(source,"CC",data[1]["ChatC"])
setElementData(source,"CarColor",data[1]["CarColor"])
end
end
addEventHandler("onPlayerLogin",getRootElement(), addPlayer)