midoking

vip lua commands

Feb 13th, 2017
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.11 KB | None | 0 0
  1. -- Designed by EmuServers Dev
  2.  
  3. local VIP = 1
  4. local active_1 = 1
  5. local active_0 = 0
  6.  
  7.  
  8. -- Custom Spell List
  9. local Spell1 = 15366
  10. local Spell2 = 16609
  11. local Spell3 = 48162
  12. local Spell4 = 48074
  13. local Spell5 = 48170
  14. local Spell6 = 43223
  15. local Spell7 = 36880
  16. local Spell8 = 467
  17. local Spell9 = 69994
  18. local Spell10 = 33081
  19. local Spell11 = 24705
  20. local Spell12 = 26035
  21. local Spell13 = 48469
  22.  
  23. -- Custom Text Modify this.
  24.  
  25. local NoVIP1     = "|cffff0000[SystemVip]|r I am sorry"
  26. local NoVIP2     = "You not are VIP |r"
  27. --Custom Text VIP Command
  28. local ActiveVip1 = "|cffff0000[SystemVip]|r"
  29. local ActiveVip2 = "Please activate your vip on"
  30. -- Custom Vip oN
  31. local VipOn      = "|cff00ff00|TInterface\\icons\\spell_holy_fanaticism:15|t|r VIP Activated |cffff0000"
  32. -- Custom Vip Off
  33. local VipOff     = "|cff00ff00|TInterface\\icons\\Spell_Shadow_DeathScream:15|t|r ¡VIP Off! |cffff0000"
  34. -- Custom Buff Active
  35. local Buff = "|cff00ff00|TInterface\\icons\\Spell_Nature_StormReach:15|t|r You're Buffed |cffff0000"
  36.  
  37.  
  38. local function CustomVipActive(event, player, msg, _, lang)
  39.     local result = AuthDBQuery("SELECT AccountId FROM account_vip WHERE Vip_Level=1 and AccountId = "..player:GetAccountId())
  40.     if (msg == ".vip on") then  -- Use #premium for sending the gossip menu
  41.         if (result) then
  42.             OnMenuVipOnHello(event, player)
  43.         else
  44.             player:SendBroadcastMessage(""..NoVIP1.." "..player:GetName()..""..NoVIP2.."")
  45.         end
  46.     end
  47. end
  48.    
  49. local function CustomVipOff(event, player, msg, _, lang)
  50.     local result = AuthDBQuery("SELECT AccountId FROM account_vip WHERE Vip_Level=1 and AccountId = "..player:GetAccountId())
  51.     if (msg == ".vip off") then  -- Use #premium for sending the gossip menu
  52.         if (result) then
  53.             OnMenuVipOffHello(event, player)
  54.         else
  55.             player:SendBroadcastMessage(""..NoVIP1.." "..player:GetName()..""..NoVIP2.."")
  56.         end
  57.     end
  58. end
  59.  
  60. local function Custom0OnChat(event, player, msg, _, lang)
  61.     local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
  62.     if (msg == "#buff") then  --
  63.         if (result) then
  64.             OnMenu0Hello(event, player)
  65.         else
  66.             player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
  67.         end
  68.     end
  69. end
  70.  
  71. local function Custom1OnChat(event, player, msg, _, lang)
  72.     local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
  73.     if (msg == "#repairmyitems") then  --
  74.         if (result) then
  75.             OnMenu1Hello(event, player)
  76.         else
  77.             player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
  78.         end
  79.     end
  80. end
  81.  
  82. local function Custom2OnChat(event, player, msg, _, lang)
  83.     local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
  84.     if (msg == "#bank") then  --
  85.         if (result) then
  86.             OnMenu2Hello(event, player)
  87.         else
  88.             player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
  89.         end
  90.     end
  91. end
  92.  
  93. local function Custom3OnChat(event, player, msg, _, lang)
  94.     local result3 = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
  95.     if (msg == "#televip") then  --
  96.         if (result3) then
  97.             OnMenu3Hello(event, player)    
  98.         else
  99.             player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
  100.         end
  101.     end
  102. end
  103.  
  104. function OnMenuVipOnHello(envent, player)
  105. AuthDBQuery("REPLACE INTO Account_VIP (AccountId, Vip_Level, active) VALUES ("..player:GetAccountId().. ","..VIP..","..active_1..")")
  106. player:SendAreaTriggerMessage(""..VipOn..""..player:GetName().."")
  107. player:SendBroadcastMessage(""..VipOn..""..player:GetName().."")  
  108. end
  109.  
  110. function OnMenuVipOffHello(envent, player)
  111. AuthDBQuery("UPDATE auth.Account_VIP SET `active`='"..active_0.."' WHERE `AccountId`='"..player:GetAccountId().."';");
  112. player:SendAreaTriggerMessage(""..VipOff..""..player:GetName().."")
  113. player:SendBroadcastMessage(""..VipOff..""..player:GetName().."")  
  114. end
  115.  
  116. function OnMenu0Hello(event, player)
  117.     player:CastSpell(player, Spell1, true)
  118.     player:CastSpell(player, Spell2, true)
  119.     player:CastSpell(player, Spell3, true)
  120.     player:CastSpell(player, Spell4, true)
  121.     player:CastSpell(player, Spell5, true)
  122.     player:CastSpell(player, Spell6, true)
  123.     player:CastSpell(player, Spell7, true)
  124.     player:CastSpell(player, Spell8, true)
  125.     player:CastSpell(player, Spell9, true)
  126.     player:CastSpell(player, Spell10, true)
  127.     player:CastSpell(player, Spell11, true)
  128.     player:CastSpell(player, Spell12, true)
  129.     player:CastSpell(player, Spell13, true)
  130.     player:SendAreaTriggerMessage(""..Buff..""..player:GetName().."")
  131.     player:SendBroadcastMessage(""..Buff..""..player:GetName().."")  
  132. end
  133.  
  134.  
  135. local Repair = "|cff00ff00Your Items Are Fixed |cffff0000"
  136. local Bank = "|cff00ff00Bank of |cffff0000"
  137. local MsgTele = "|cff00FF1DTeleporting [zone vip]"
  138.    
  139. function OnMenu1Hello(event, player)
  140.     player:DurabilityRepairAll()
  141.     player:SendBroadcastMessage(""..Repair..""..player:GetName().."")
  142.     player:GossipComplete()
  143. end
  144.    
  145.    
  146. function OnMenu2Hello(event, player)
  147.     player:SendShowBank(player)
  148.     player:SendBroadcastMessage(""..Bank..""..player:GetName().."")
  149.     player:GossipComplete()
  150. end
  151.    
  152. function OnMenu3Hello(event, player)
  153.     player:Teleport(0, 4298.775879, -2762.187256, 16.632673, 3.633596)
  154.     player:Dismount()
  155.     player:SendBroadcastMessage(""..MsgTele"..")
  156.     player:SendNotification("|cff00FF1DWait a minute.....")
  157.     player:GossipComplete()
  158. end
  159.    
  160. local function VIPLogout (event, player) --This Remove Vip On.
  161.     AuthDBQuery("UPDATE auth.Account_VIP SET `active`='"..active_0.."' WHERE `AccountId`='"..player:GetAccountId().."';");
  162. end
  163.  
  164.  
  165. RegisterPlayerEvent(4, VIPLogout)
  166. RegisterPlayerEvent(18, Custom0OnChat)
  167. RegisterPlayerEvent(18, Custom1OnChat)
  168. RegisterPlayerEvent(18, Custom2OnChat)
  169. RegisterPlayerEvent(18, Custom3OnChat)
  170. RegisterPlayerEvent(18, CustomVipActive)
  171. RegisterPlayerEvent(18, CustomVipOff)
  172. print("+ Script VIP-System Active +")
Advertisement
Add Comment
Please, Sign In to add comment