Advertisement
Guest User

Untitled

a guest
Jan 24th, 2015
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. function MoneyLogTimerInit()
  2.  
  3.     timer.Create( "UniqueName", 3600, 0, LogMoney)
  4.  
  5. end
  6. function LogMoney()
  7.     local Timestamp = os.time()
  8.     local TimeStr = os.date( "%X - %d/%m/%Y" , Timestamp )
  9.     local Filename = Timestamp + TimeStr + ".log"
  10.     local Result = ""
  11.         for k, v in pairs(player.GetAll()) do
  12.             local Money = v.DarkRPVars.money
  13.             local Name = v:nick()
  14.             Result = Result .. Name .. " $" .. Money .. "\n"
  15.         end
  16.     file.Write( "MoneyLogs/" .. Filename, Result )
  17.  
  18. end
  19.  
  20. hook.Add( "Initialize", "MoneyLog", MoneyLogTimerInit )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement