ACheats

ruletka

May 17th, 2018 (edited)
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.00 KB | None | 0 0
  1. ruletka = {0,1,2,1,2,1,2,1,2,1,2,2,1,2,1,2,1,2,1,1,2,1,2,1,2, 1,2,1, 2,2,1,2,1,2,1,2,1}
  2.  
  3. function CreateBalance(name,ammount)
  4.   data.ballance = ammount
  5.   setLocalData(name, data)
  6.   return "*Поздравляем! Вы открыли счет.\n Получите 100$ на ваш лицевой счет в подарок."
  7. end
  8.  
  9. function getColor(number)
  10.     local color = {
  11.       [0] = "green",
  12.       [1] = "red",
  13.       [2] = "black"
  14.     }
  15.     return color[ruletka[number]]
  16. end
  17. -------------------------------
  18. function ShowCheck(username)
  19.   local data = getLocalData(username)
  20.   local str = [[====Рулетка====
  21.   Ваше имя: ]] ..username .. "\n" .. [[
  22.   Баланс:]] .. data.ballance .. "$\n"
  23.   return str
  24. end
  25. --------------------------------
  26.  
  27. if(_ARGS and string.find(_ARGS,"info ") and getScriptCaller().username == "mgmoldova")
  28. then
  29.   local username = string.gsub( _ARGS, "info ","" )
  30.   if(getLocalData(username))
  31.   then return ShowCheck(username)
  32.   else return "ERROR"
  33.   end
  34. end
  35.  
  36.  
  37. ball = math.random(0, 36)
  38. local data = getLocalData(getScriptCaller().username)
  39. if(_ARGS and string.find(_ARGS,"bet red ")  and getScriptCaller().username)
  40. then
  41.     local value = string.match(_ARGS, "(%d+)")
  42.     if(data.ballance < value / 1 )
  43.     then return "У вас недостаточно средств на лицевом счете."
  44.     else
  45.       data.ballance = data.ballance - value
  46.       local str = "Ставка: " .. value .. " [Коефициент x3]" .. "\nВыпало " .. ball .. " (" .. getColor(ball) ..")\n"
  47.       if (getColor(ball) == "red") then str = str .. "Вы выиграли " .. value * 3 .. "$"  .. "\nСостояние счета: " .. data.ballance .. "$"
  48.         data.ballance = data.ballance + value * 3
  49.       else str = str .. "Вы проиграли " .. value  .. "\nСостояние счета: " .. data.ballance .. "$" end
  50.       setLocalData(getScriptCaller().username, data)
  51.     return str
  52.     end
  53. elseif (_ARGS and string.find(_ARGS,"bet black ")  and getScriptCaller().username)
  54. then
  55. local value = string.match(_ARGS, "(%d+)")
  56. if(data.ballance < value / 1 ) then return "У вас недостаточно средств на лицевом счете."
  57. else
  58.   data.ballance = data.ballance - value
  59.   local str = "Ставка: " .. value .. " [Коефициент x3]".."\nВыпало " .. ball .. " (" .. getColor(ball) ..")\n"
  60.   if (getColor(ball) == "black") then str = str .. "Вы выиграли " .. value * 3 .. "$" .. "\nСостояние счета: " .. data.ballance .."$"
  61.      data.ballance = data.ballance + value * 3
  62.   else str = str .. "Вы проиграли " .. value  .. "\nСостояние счета: " .. data.ballance .."$" end
  63.   setLocalData(getScriptCaller().username, data)
  64. return str
  65. end
  66. elseif (_ARGS and string.find(_ARGS,"bet green ")  and getScriptCaller().username)
  67. then
  68.   local value = string.match(_ARGS, "(%d+)")
  69.   if(data.ballance < value / 1)
  70.   then return "У вас недостаточно средств на лицевом счете."
  71.   else
  72.     data.ballance = data.ballance - value
  73.     local str = "Ставка: " .. value .. "$ [Коефициент x3]".. "\nВыпало: " .. ball .. " (" .. getColor(ball) ..")\n"
  74.     if (getColor(ball) == "green") then str = str .. "Вы выиграли: " .. value * 3 .. "$"  .. "\nСостояние счета: " .. data.ballance .."$"
  75.        data.ballance = data.ballance + value * 3
  76.     else str = str .. "Вы проиграли: " .. value .. "\nСостояние счета: " .. data.ballance.. "$"  end
  77.     setLocalData(getScriptCaller().username, data)
  78.   return str
  79.   end
  80. end
  81.  
  82.  
  83. if(_ARGS and string.find(_ARGS,"bet ")  and getScriptCaller().username and string.match(_ARGS, "(%d+) (%d+)") )
  84. then
  85.   local value, bet = string.match(_ARGS, "(%d+) (%d+)")
  86.   if(data.ballance < value / 1)
  87.   then return "У вас недостаточно средств на лицевом счете."
  88.   else
  89.  
  90.     data.ballance = data.ballance - value
  91.     local ball = math.random(0, 36)
  92.     local str = "Ставка: "  .. value .. " Коефициент x36 " .. "Вы поставили на: " .. bet .."\nВыпало " .. ball .. " (" .. getColor(ball) ..")\n"
  93.     if (bet == ball) then str = str .. "Вы выиграли " .. value * 3; data.ballance = data.ballance + value * 36  .. "\nСостояние счета: " .. data.ballance "$"
  94.     else str = str .. "Вы проиграли " .. value .. "\nСостояние счета: " .. data.ballance .."$" end
  95.     setLocalData(getScriptCaller().username, data)
  96.   return str
  97.   end
  98. end
  99.  
  100. --  getScriptCaller() - get information of a user who called the script, returns table with fields id, username, first_name, last_name
  101. if(getScriptCaller().username)
  102. then caller = getScriptCaller().username
  103.   if(getLocalData(caller) or not (getLocalData(caller)== nil))
  104.   then return ShowCheck(getScriptCaller().username)
  105.   else CreateBalance(caller,100)  end
  106.   else return "getScriptCaller().username" end
Add Comment
Please, Sign In to add comment