Advertisement
Dkdrian

LoginAnnounce

Apr 9th, 2021
528
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.77 KB | None | 0 0
  1. --[[
  2.     LoginAnnounce for Azerothcore and Trinitycore Eluna 3.3.5a
  3.     Discord: elperroblack#6996
  4. ]]
  5.  
  6. local GameMasterAnnouncement = true -- false = Ignore GameMasters
  7. local strings = {
  8.     serverName = "LoginAnnouncer  ",
  9.     faction = {
  10.         [0] = "|cff0000FFAlliance|r",
  11.         [1] = "|cffFF0000Horde|r"
  12.     },
  13.     colorClass = {
  14.         [1] = "|cffC79C6E", -- Warrior
  15.         [2] = "|cffF58CBA", -- Paladin
  16.         [3] = "|cffABD473", -- Hunter
  17.         [4] = "|cffFFF569", -- Rogue
  18.         [5] = "|cffFFFFFF", -- Priest
  19.         [6] = "|cffC41F3B", -- Death Knight
  20.         [7] = "|cff0070DE", -- Shaman
  21.         [8] = "|cff69CCF0", -- Mage
  22.         [9] = "|cff9482C9", -- Warlock
  23.         [11] = "|cffFF7d0A" -- Druid
  24.     }
  25. }
  26. local icons = {
  27.     faction = {
  28.         [0] = "|TInterface/icons/Inv_Misc_Tournaments_banner_Human:13|t", -- Alliance
  29.         [1] = "|TInterface/icons/Inv_Misc_Tournaments_banner_Orc:13|t" -- Horde
  30.     },
  31.     gameMaster = "|TInterface/icons/Mail_GMIcon:13:20|t", -- GameMaster
  32.     logo = "|TInterface/ICONS/Temp:15|t " -- Logo World of Warcraft
  33. }
  34.  
  35. local function LoginAnnouncer(eventid, delay, repeats, player)
  36.     local msg
  37.     if GameMasterAnnouncement and player:GetGMRank() >= 1 then
  38.             msg = icons.logo ..strings.serverName ..icons.gameMaster .."|cff2ECCFA" ..player:GetName() .."|r " .. "is online.|r"
  39.     else
  40.         if player:GetGMRank() < 1 then
  41.             msg = icons.logo ..strings.serverName ..icons.faction[player:GetTeam()] ..strings.colorClass[player:GetClass()] ..player:GetName() .."|r "  .."is online.|r"
  42.         end
  43.     end
  44.     if msg then
  45.         SendWorldMessage(msg)
  46.     end
  47. end
  48.  
  49. local function OnLogin(event, player)
  50.     player:RegisterEvent(LoginAnnouncer, 1000)
  51. end
  52. RegisterPlayerEvent(3, OnLogin)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement