Skymagnum

[MaTa] Eh TiRuU

Jun 1st, 2013
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1. function onSay(cid, words, param, channel)
  2.  
  3. local time = getPlayerStorageValue(cid, 83922)
  4. local r = os.date("%d %B %Y %X", time)
  5. local price = 5000000 -- per day
  6.  
  7.     if(tonumber(param) and tonumber(param) < 365) then
  8.         if(doPlayerRemoveMoney(cid, price * param)) then
  9.             if(time - os.time() < 1) then
  10.                 setPlayerStorageValue(cid, 83922, os.time() + 86400 * param)
  11.                 return doPlayerSendTextMessage(cid, 27, "You now have access until: " .. r)
  12.             else
  13.                 return doPlayerSendTextMessage(cid, 28, "You still have access until: " .. r)
  14.             end
  15.         else
  16.             return doPlayerSendCancel(cid, "You need " .. (param * price) .. " gold coins.")
  17.         end
  18.     else
  19.         return doPlayerSendCancel(cid, words .. " days(max is 365).")
  20.     end
  21.  
  22.     return true
  23. end
Advertisement
Add Comment
Please, Sign In to add comment