ahmedo01 Posted December 27, 2014 Share Posted December 27, 2014 Hello All, I am working on a new system but i need this. server code: function getPunishments(player) local playeraccount = getPlayerAccount( player ) local accname = getAccountName( playeraccount ) local mypunishments = mysql_query ( db, "SELECT * FROM `punishments` WHERE `accountname` = '"..accname.."'" ) local result,row = mysql_rows(mypunishments) local set = setElementData(player,"CGC.punishmentsdata",toJSON(row)) end addEvent("CGC.getPunishments",true) addEventHandler( "CGC.getPunishments", getRootElement( ), getPunishments) here is client side: local row = getElementData(getLocalPlayer( ),"CGC.punishmentsdata") and for row1 in fromJSON(row) do outputChatBox(row1[1]..row1[2]) end but don't working.I want get informations from database to client side but how? It gives error in debugscript couldn't convert userdata argument to JSON, only valid resources can be included for this function. 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