kusanagy

Custom Command Vip on / off

Feb 6th, 2017
633
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.21 KB | None | 0 0
  1. --[[
  2.                          ▒█▀▀▀ █▀▄▀█ █░░█ ▒█▀▀▀█ █▀▀ █▀▀█ ▀█░█▀ █▀▀ █▀▀█  
  3.                          ▒█▀▀▀ █░▀░█ █░░█ ░▀▀▀▄▄ █▀▀ █▄▄▀ ░█▄█░ █▀▀ █▄▄▀  
  4.                          ▒█▄▄▄ ▀░░░▀ ░▀▀▀ ▒█▄▄▄█ ▀▀▀ ▀░▀▀ ░░▀░░ ▀▀▀ ▀░▀▀    
  5.                      
  6.                                   ██████╗ ██████╗ ██████╗ ███████╗            
  7.                                  ██╔════╝██╔═══██╗██╔══██╗██╔════╝            
  8.                                  ██║     ██║   ██║██████╔╝█████╗            
  9.                                  ██║     ██║   ██║██╔══██╗██╔══╝            
  10.                                  ╚██████╗╚██████╔╝██║  ██║███████╗            
  11.                                   ╚═════╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝
  12.                      
  13.                             EmuServers WoW Creado por Kusanagy Azakura*
  14.                            
  15. /*
  16. Navicat MySQL Data Transfer
  17.  
  18. Source Server         : DarkFallen
  19. Source Server Version : 50626
  20. Source Host           : localhost:3306
  21. Source Database       : auth
  22.  
  23. Target Server Type    : MYSQL
  24. Target Server Version : 50626
  25. File Encoding         : 65001
  26.  
  27. Date: 2017-01-29 01:05:41
  28. */
  29.  
  30. SET FOREIGN_KEY_CHECKS=0;
  31.  
  32. -- ----------------------------
  33. -- Table structure for account_vip
  34. -- ----------------------------
  35. DROP TABLE IF EXISTS `account_vip`;
  36. CREATE TABLE `account_vip` (
  37.   `AccountId` int(11) NOT NULL DEFAULT '0',
  38.   `Vip_Level` int(11) NOT NULL DEFAULT '0',
  39.   `active` int(11) DEFAULT NULL,
  40.   PRIMARY KEY (`AccountId`)
  41. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  42.  
  43. -- ----------------------------
  44. -- Records of account_vip
  45. -- ----------------------------                        
  46. --]]
  47.  
  48.  
  49. local VIP      = 1
  50. local active_1 = 1
  51. local active_0 = 0
  52.  
  53.  
  54. -- Custom Spell List
  55. local Spell1 = 15366
  56. local Spell2 = 16609
  57. local Spell3 = 48162
  58. local Spell4 = 48074
  59. local Spell5 = 48170
  60. local Spell6 = 43223
  61. local Spell7 = 36880
  62. local Spell8 = 467
  63. local Spell9 = 69994
  64. local Spell10 = 33081
  65. local Spell11 = 24705
  66. local Spell12 = 26035
  67. local Spell13 = 48469
  68.  
  69. -- Custom Text Modify this.
  70.  
  71. local NoVIP1     = "|cffff0000[SystemVip]|r I am sorry"
  72. local NoVIP2     = "Tu no eres VIP |r"
  73. --Custom Text VIP Command
  74. local ActiveVip1 = "|cffff0000[SystemVip]|r"
  75. local ActiveVip2 = "Please activate your vip on"
  76. -- Custom Vip oN
  77. local VipOn      = "|cff00ff00|TInterface\\icons\\spell_holy_fanaticism:15|t|r VIP Activated |cffff0000"
  78. -- Custom Vip Off
  79. local VipOff     = "|cff00ff00|TInterface\\icons\\Spell_Shadow_DeathScream:15|t|r ¡VIP Off! |cffff0000"
  80. -- Custom Buff Active
  81. local Buff       = "|cff00ff00|TInterface\\icons\\Spell_Nature_StormReach:15|t|r You're Buffed |cffff0000"
  82.  
  83.  
  84. local function CustomVipActive(event, player, msg, _, lang)
  85.     local result = AuthDBQuery("SELECT AccountId FROM account_vip WHERE Vip_Level=1 and AccountId = "..player:GetAccountId())
  86.     if (msg == "#vip on") then  -- Use #premium for sending the gossip menu
  87.         if (result) then
  88.             OnMenuVipOnHello(event, player)
  89.         else
  90.             player:SendBroadcastMessage(""..NoVIP1.." "..player:GetName()..""..NoVIP2.."")
  91.         end
  92.     end
  93. end
  94.    
  95. local function CustomVipOff(event, player, msg, _, lang)
  96.     local result = AuthDBQuery("SELECT AccountId FROM account_vip WHERE Vip_Level=1 and AccountId = "..player:GetAccountId())
  97.     if (msg == "#vip off") then  -- Use #premium for sending the gossip menu
  98.         if (result) then
  99.             OnMenuVipOffHello(event, player)
  100.         else
  101.             player:SendBroadcastMessage(""..NoVIP1.." "..player:GetName()..""..NoVIP2.."")
  102.         end
  103.     end
  104. end
  105.  
  106. local function Custom0OnChat(event, player, msg, _, lang)
  107.     local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
  108.     if (msg == "#buff") then  --
  109.         if (result) then
  110.             OnMenu0Hello(event, player)
  111.         else
  112.             player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
  113.         end
  114.     end
  115. end
  116.  
  117. local function Custom1OnChat(event, player, msg, _, lang)
  118.     local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
  119.     if (msg == "#repair") then  --
  120.         if (result) then
  121.             OnMenu1Hello(event, player)
  122.         else
  123.             player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
  124.         end
  125.     end
  126. end
  127.  
  128. local function Custom2OnChat(event, player, msg, _, lang)
  129.     local result = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
  130.     if (msg == "#bank") then  --
  131.         if (result) then
  132.             OnMenu2Hello(event, player)
  133.         else
  134.             player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
  135.         end
  136.     end
  137. end
  138.  
  139. local function Custom3OnChat(event, player, msg, _, lang)
  140.     local result3 = AuthDBQuery("SELECT AccountId FROM Account_VIP WHERE active=1 and AccountId = "..player:GetAccountId())
  141.     if (msg == "#televip") then  --
  142.         if (result3) then
  143.             OnMenu3Hello(event, player)    
  144.         else
  145.             player:SendBroadcastMessage(""..ActiveVip1.." "..player:GetName().." "..ActiveVip2.."")
  146.         end
  147.     end
  148. end
  149.  
  150. function OnMenuVipOnHello(envent, player)
  151. AuthDBQuery("REPLACE INTO Account_VIP (AccountId, Vip_Level, active) VALUES ("..player:GetAccountId().. ","..VIP..","..active_1..")")
  152. player:SendAreaTriggerMessage(""..VipOn..""..player:GetName().."")
  153. player:SendBroadcastMessage(""..VipOn..""..player:GetName().."")  
  154. end
  155.  
  156. function OnMenuVipOffHello(envent, player)
  157. AuthDBQuery("UPDATE auth.Account_VIP SET `active`='"..active_0.."' WHERE `AccountId`='"..player:GetAccountId().."';");
  158. player:SendAreaTriggerMessage(""..VipOff..""..player:GetName().."")
  159. player:SendBroadcastMessage(""..VipOff..""..player:GetName().."")  
  160. end
  161.  
  162. function OnMenu0Hello(event, player)
  163.     player:CastSpell(player, Spell1, true)
  164.     player:CastSpell(player, Spell2, true)
  165.     player:CastSpell(player, Spell3, true)
  166.     player:CastSpell(player, Spell4, true)
  167.     player:CastSpell(player, Spell5, true)
  168.     player:CastSpell(player, Spell6, true)
  169.     player:CastSpell(player, Spell7, true)
  170.     player:CastSpell(player, Spell8, true)
  171.     player:CastSpell(player, Spell9, true)
  172.     player:CastSpell(player, Spell10, true)
  173.     player:CastSpell(player, Spell11, true)
  174.     player:CastSpell(player, Spell12, true)
  175.     player:CastSpell(player, Spell13, true)
  176.     player:SendAreaTriggerMessage(""..Buff..""..player:GetName().."")
  177.     player:SendBroadcastMessage(""..Buff..""..player:GetName().."")  
  178. end
  179.  
  180.  
  181. local Repair = "|cff00ff00Your Items Are Fixed |cffff0000"
  182. local Bank   = "|cff00ff00Bank of |cffff0000"
  183. local MsgTele = "|cff00FF1DTeleporting [zone vip]"
  184.    
  185. function OnMenu1Hello(event, player)
  186.     player:DurabilityRepairAll()
  187.     player:SendBroadcastMessage(""..Repair..""..player:GetName().."")
  188.     player:GossipComplete()
  189. end
  190.    
  191.    
  192. function OnMenu2Hello(event, player)
  193.     player:SendShowBank(player)
  194.     player:SendBroadcastMessage(""..Bank..""..player:GetName().."")
  195.     player:GossipComplete()
  196. end
  197.    
  198. function OnMenu3Hello(event, player)
  199.     player:Teleport(0, 4298.775879, -2762.187256, 16.632673, 3.633596)
  200.     player:Dismount()
  201.     player:SendBroadcastMessage(""..MsgTele"..")
  202.     player:SendNotification("|cff00FF1DWait a minute.....")
  203.     player:GossipComplete()
  204. end
  205.    
  206. local function VIPLogout (event, player) --This Remove Vip On.
  207.     AuthDBQuery("UPDATE auth.Account_VIP SET `active`='"..active_0.."' WHERE `AccountId`='"..player:GetAccountId().."';");
  208. end
  209.  
  210.  
  211. RegisterPlayerEvent(4, VIPLogout)
  212. RegisterPlayerEvent(18, Custom0OnChat)
  213. RegisterPlayerEvent(18, Custom1OnChat)
  214. RegisterPlayerEvent(18, Custom2OnChat)
  215. RegisterPlayerEvent(18, Custom3OnChat)
  216. RegisterPlayerEvent(18, CustomVipActive)
  217. RegisterPlayerEvent(18, CustomVipOff)
  218. print("+ Script VIP-System Active +")
Advertisement
Add Comment
Please, Sign In to add comment