FSXTim Posted June 13, 2012 Posted June 13, 2012 Hello, I have an error in my script (line 5): attempt to concatenate a boolean value function onStart () for index, source in pairs (getElementsByType("player")) do local result = mysql_query(sqlcon, "UPDATE user_data SET Adminlevel='"..getElementData(source,"Adminlevel").."', Spielzeit='"..getElementData(source,"Spielzeit").."', Geld='"..getElementData(source,"Geld").."', \ Status='"..getElementData(source,"Status").."', Wins='"..getElementData(source,"Wins").."', Repairs='"..getElementData(source,"Repairs").."', Nitros='"..getElementData(source,"Nitros").."', \ Tampas='"..getElementData(source,"Tampas").."', Freezes='"..getElementData(source,"Freezes").."', Bomben='"..getElementData(source,"Bomben").."' WHERE Username='"..getElementData(source,"Username").."';") mysql_free_result( result ) end setTimer(onStart, 50, 1, 0) end addEventHandler ( "onResourceStart", getRootElement(), onStart ) Greets
FSXTim Posted June 13, 2012 Author Posted June 13, 2012 Your player doesn't have "Tampas" data. What do you mean? In my database there is a table, which calls 'Tampas'. Greets
Kenix Posted June 13, 2012 Posted June 13, 2012 You should check all element data in 5 line. Via functions outputDebugString outputChatBox tostring type
FSXTim Posted June 13, 2012 Author Posted June 13, 2012 You should check all element data in 5 line. Via functions outputDebugString outputChatBox tostring type I did that. function onTest (player) outputChatBox(""..getElementData(player, "Adminlevel").."") outputChatBox(""..getElementData(player, "Spielzeit").."") outputChatBox(""..getElementData(player, "Geld").."") outputChatBox(""..getElementData(player, "Status").."") outputChatBox(""..getElementData(player, "Wins").."") outputChatBox(""..getElementData(player, "Repairs").."") outputChatBox(""..getElementData(player, "Nitros").."") outputChatBox(""..getElementData(player, "Tampas").."") outputChatBox(""..getElementData(player, "Freezes").."") outputChatBox(""..getElementData(player, "Bomben").."") end addCommandHandler("testing", onTest) Result: 1 0 300 Scripter 1 2 0 0 0 0 Greets
FSXTim Posted June 13, 2012 Author Posted June 13, 2012 I tried this, only one 'getElementData': function onStart () for index, source in pairs (getElementsByType("player")) do local result = mysql_query(sqlcon, "UPDATE user_data SET Adminlevel='"..getElementData(source,"Adminlevel").."' WHERE Username='"..getElementData(source,"Username").."';") mysql_free_result( result ) end setTimer(onStart, 50, 1, 0) end addEventHandler ( "onResourceStart", getRootElement(), onStart ) Same Error (line3): attempt to concatenate a boolean value
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