Advertisement
Tearrain

Eventsystem

May 5th, 2014
268
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.31 KB | None
  1. --[[
  2.         Do not repost without my permission.
  3.         Do not take credits for what you haven't scripted.
  4.        
  5. ------------------------------------------------------
  6.     - Developer: Hei
  7.     - Complete: 100% with ElunaTrinityCata
  8.     - ScriptName: 'Eventsystem'
  9. ]]--
  10.  
  11.  
  12. local EventActivateMsg = "#start"
  13. local EventDeactivateMsg = "#stop"
  14. local JoinMsg = "#join"
  15. local Project = "Pandorum Event System"
  16.  
  17. local EventActivated = false
  18. local ReviveActivated = false
  19.  
  20.  
  21. local EventPlace = {}
  22.  
  23. function EventChatSystem(event, player, message, type, language)
  24.     if (message == EventActivateMsg) then
  25.         if (player:GetGMRank() >= 2) then
  26.             if (EventActivated == true) then
  27.                 player:SendBroadcastMessage("Zurzeit ist bereits ein Event gestartet worden. Bitte Stopt dieses um ein neues Event zu starten!")
  28.             else   
  29.             EventActivated = true
  30.                 table.insert(EventPlace, player:GetMapId())
  31.                         table.insert(EventPlace, player:GetX())
  32.                         table.insert(EventPlace, player:GetY())
  33.                         table.insert(EventPlace, player:GetZ())
  34.                 table.insert(EventPlace, player:GetZoneId())
  35.                 local plrs = GetPlayersInWorld()
  36.                 for k, v in pairs(plrs) do
  37.                     v:SendBroadcastMessage("|cff3399FF[", Project, "]: |cffDFDF18"..player:GetName().." |cffEB0000hat ein Event gestartet, gebt "..JoinMsg.." um beizutreten!")
  38.                                    v:SendAreaTriggerMessage("|cff3399FF[", Project, "]: |cffDFDF18"..player:GetName().." |cffEB0000hat ein Event gestartet, gebt "..JoinMsg.." um beizutreten!")
  39.                 return false
  40.                 end
  41.             end
  42.             end
  43.         end
  44.     if (message == EventDeactivateMsg) then
  45.         if (player:GetGMRank() == 4) or (player:GetGMRank() >= 2) then
  46.         if (EventActivated == false) then
  47.                 player:SendBroadcastMessage("Es ist keine Event Aktiviert um es zu schliessen.")
  48.             else   
  49.                 EventActivated = false
  50.                 EventPlace = {}
  51.                 local plrs = GetPlayersInWorld()
  52.                 for k, v in pairs(plrs) do
  53.                     v:SendBroadcastMessage("|cff3399FF[", Project, "]: |cffDFDF18" ..player:GetName().." |cffEB0000hat das Event beendet!")
  54.                                    v:SendAreaTriggerMessage("|cff3399FF[", Project, "]: |cffDFDF18" ..player:GetName().." |cffEB0000hat das Event beendet!")
  55.                 return false
  56.                 end
  57.             end
  58.             end
  59.         end
  60.         if (message == JoinMsg) then
  61.             if (EventActivated == false) then
  62.                     player:SendBroadcastMessage("Zurzeit findet keine Event statt.")
  63.             elseif (EventActivated == true) then
  64.                       player:SendAreaTriggerMessage("|cffEB0000Viel Spa\195\159 beim Event |cffDFDF18" ..player:GetName().." |cffEB0000:D")
  65.  
  66.             player:Teleport(EventPlace[1], EventPlace[2], EventPlace[3], EventPlace[4], EventPlace[5]) 
  67.         return false
  68.         end
  69.         end
  70.  
  71.     if (message == Remind) then
  72.         if (EventActivated == false) then
  73.             player:SendBroadcastMessage("Sie koennen diesen Befehl nur ausfuehren wenn ein Event aktiv ist.")  
  74.         else
  75.             local plrs = GetPlayersInWorld()
  76.             for k, v in pairs(plrs) do
  77.                 v:SendBroadcastMessage("Es ist bereits ein Event gestartet gebe bitte "..JoinMsg.." ein um daran teil zunehmen.")
  78.             return false
  79.             end
  80.         end
  81.     end
  82. end
  83.  
  84.  
  85. RegisterPlayerEvent(18, EventChatSystem)
  86. RegisterPlayerEvent(21, EventChatSystem)
  87. RegisterPlayerEvent(22, EventChatSystem)
  88. RegisterPlayerEvent(20, EventChatSystem)
Advertisement
RAW Paste Data Copied
Advertisement