Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: ayuda con Scripts Lua  (Visto 973 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline jorginhuz Posteado: August 19, 2018, 06:46:28 PM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 247
  • Gracias recibida: 69
  • ar
hola amigos alguien tiene ideas sobre la programacion lua? es para que me ayude a crear Scripts en LUA . Pago $$$ por mercado pago si me ayudan

Esto es un comando de POST para que vean como es lua. pero necesito de sus ayudas para nuevas cosas.

--[[ Post System ]]--

Post = {}

local TimerPost = {}

function Post.Running()
   if #TimerPost == 0
   then
      return
   end

   local i=1
   while i <= #TimerPost do
      if math.floor(math.abs(GetTick() - TimerPost[TimerPost]) / 1000) > POST_TIMER
      then
         RemoveKey(TimerPost, i)
      else
         i = i + 1
      end
   end
end

function Post.Command(aIndex, Arguments)
   if POST_SWITCH == 0
   then
      return
   end
   
   if TimerPost[UserGetName(aIndex)] ~= nil
   then
      local tick = math.floor(math.abs(GetTick() - TimerPost[UserGetName(aIndex)]) / 1000)

      if tick < POST_TIMER
      then
         SendMessage(string.format("[Sistema] Você tem que esperar %d segundo(s) para utilizar o %s novamente.", math.floor(POST_TIMER - tick), POST_COMMAND), aIndex, 1)
         return
      end
   end
   
   if UserGetLevel(aIndex) < POST_LEVEL
   then
      SendMessage(string.format("[Sistema] Você precisa estar acima do level %d", POST_LEVEL), aIndex, 1)
      return
   end
   
   local money = UserGetMoney(aIndex)
   
   if money < POST_MONEY
   then
      SendMessage(string.format("[Sistema] Você precisa de %d zen", POST_MONEY), aIndex, 1)
      return
   end
   
   if DataBase.GetValue(TABLE_VIP, COLUMN_VIP, WHERE_VIP, UserGetAccountID(aIndex)) < POST_VIP
   then
      SendMessage(string.format("[Sistema] Somente usuários vip podem usar este comando!"), aIndex, 1)
      return
   end
   
   local Name = UserGetName(aIndex)

   if DataBase.GetValue(TABLE_RESET, COLUMN_RESET[0], WHERE_RESET, Name) < POST_RESET
   then
      SendMessage(string.format("[Sistema] Você precisa de %d resets", POST_RESET), aIndex, 1)
      return
   end
   
   if DataBase.GetValue(TABLE_MRESET, COLUMN_MRESET[0], WHERE_MRESET, Name) < POST_MRESET
   then
      SendMessage(string.format("[Sistema] Você precisa de %d M.Resets", POST_MRESET), aIndex, 1)
      return
   end
   
   local setmoney = money - POST_MONEY
   
   UserSetMoney(aIndex, setmoney)
   MoneySend(aIndex)
   SendMessageGlobal(string.format(POST_STRING, UserGetName(aIndex), CommandGetString(Arguments, 1, 1)), POST_COLOR)
   
   --[[Insert Timer Post]]--
   
   if TimerPost[UserGetName(aIndex)] == nil
   then
      InsertKey(TimerPost, UserGetName(aIndex))
      TimerPost[UserGetName(aIndex)] = GetTick()
   else
      TimerPost[UserGetName(aIndex)] = GetTick()
   end
end

Commands.Register(POST_COMMAND, Post.Command)
Timer.Interval(1, Post.Running)

return Post

Gracias:


Offline jorginhuz #1 Posteado: August 19, 2018, 11:09:12 PM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 247
  • Gracias recibida: 69
  • ar

Offline Natzugen #2 Posteado: August 19, 2018, 11:21:20 PM

  • MAESTRO

  • C++ Coder
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 548
  • Gracias recibida: 18698
  • co

Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
0 Replies
401 Views
Last post November 18, 2021, 10:29:12 AM
by awebravo
3 Replies
532 Views
Last post March 12, 2022, 06:35:23 AM
by 6atters
0 Replies
660 Views
Last post September 10, 2022, 10:59:43 AM
by Senaris
2 Replies
1996 Views
Last post July 26, 2023, 05:30:14 PM
by OBBY
4 Replies
690 Views
Last post October 08, 2023, 09:13:06 PM
by ZabiinoOo