Okay, I can't fix this for the love of my life. I've tried every day for the past week now, trying different ways to get this to work. All I want is to be able to change someones hours while in game, and I keep getting this error saying:
bad key to string index (number expected, got string)
and I pretty much know what that means, but I don't understand why it's doing that.
This is the code I'm using to change someone's time..
concommand.Add("UMGroup", function( ply, cmd, args )
if (ply:query( "utime_m_settings" )) then
Msg( "Player " ..args[1].. " time was changed to " ..args[2].. " hours\n" )
xgui.sendDataTable( {}, "UM_SendData" )
end
pl = args[1]
amt = args[2]
--pl:PrintMessage(HUD_PRINTTALK,decoded[2])
sql.Query( "UPDATE utime SET totaltime = " .. math.floor( pl:amt() ) .. " WHERE player = " .. pl:UniqueID() .. ";" )
updateAll()
If ANYONE see's anything wrong with this please tell me, or if you need more of the code for any reason, I'll give it, but I really just want help on this... or I'll just unfortunally have to message Sticky Man or Megiddo on this, which I hope I don't have to bother them :/