Snow-Man Posted July 12, 2014 Share Posted July 12, 2014 function addPlayerPunishments(thePlayer) local account = getPlayerAccount(thePlayer) if (account) and not (isGuestAccount(account)) then local accountName = getAccountName(account) local serial = getPlayerSerial(thePlayer) Local time = getRealTime().timestamp return exports.USCsql:Execdb("INSERT INTO punishlogs (account,serial,time) VALUES(?,?,?)", accountName, serial, time) end return false end When i use this export, i didn't found any data in db Help? Link to comment
xXMADEXx Posted July 12, 2014 Share Posted July 12, 2014 You're defining time with Local. It should be local. If it still doesn't work please post your whole code, and the Execdb function along with any debug errors that are appearing. function addPlayerPunishments ( source ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then local accName = getAccountName ( account ) local serial = getPlayerSerial ( source ) local time = getRealTime ( ).timestamp local exe = exports.USCsql:Execdb ( "INSERT INTO punishlog ( account, serial, time ) VALUES ( ?, ?, ? )", tostring ( accName ), tostring ( serial ), tostring ( time ) ) return exe end return false end Link to comment
Snow-Man Posted July 22, 2014 Author Share Posted July 22, 2014 WARNING: USCstaff\server.lua:6: Bad argument @ 'getPlayerAccount' [Expected element at argument 1, got nil] Link to comment
Snow-Man Posted July 28, 2014 Author Share Posted July 28, 2014 done, i fixed it /lock please 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