Advertisement
TheBakkeseKing

Lista players MTA en discord

Jul 8th, 2025
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | Gaming | 0 0
  1. -- server.lua
  2.  
  3. local webhookURL = "https://discord.com/api/webhooks/XXXXX/XXXXXXXX" -- Reemplaza con tu webhook
  4.  
  5. function sendActivePlayersToWebhook()
  6.     local players = getElementsByType("player")
  7.     if #players == 0 then return end
  8.  
  9.     local lines = {}
  10.     for _, player in ipairs(players) do
  11.         table.insert(lines, "• " .. getPlayerName(player))
  12.     end
  13.  
  14.     local message = "**Usuarios activos en el servidor:**\n" .. table.concat(lines, "\n")
  15.  
  16.     fetchRemote(webhookURL, {
  17.         method = "POST",
  18.         headers = { ["Content-Type"] = "application/json" },
  19.         postData = toJSON({ content = message })
  20.     })
  21. end
  22.  
  23. setTimer(sendActivePlayersToWebhook, 3600000, 0) -- Cada 1 hora
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement