CapsAdmin

Untitled

Jan 7th, 2012
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.35 KB | None | 0 0
  1. cookies = {}
  2.  
  3. function cookies.Set(key, value)
  4.     luadata.SetKeyValueInFile("cookies.txt", key, value)
  5.  
  6.     cookies.current[key] = value
  7. end
  8.  
  9. function cookies.Get(key, def)
  10.     if not cookies.current then cookies.Reload() end
  11.  
  12.     return cookies.current[key] or def
  13. end
  14.  
  15. function cookies.Reload()
  16.     cookies.current = luadata.ReadFile("cookies.txt")
  17. end
Advertisement
Add Comment
Please, Sign In to add comment