kusanagy

Buff Command + SQL

Jan 31st, 2017
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.11 KB | None | 0 0
  1. --[[
  2.                          ▒█▀▀▀ █▀▄▀█ █░░█ ▒█▀▀▀█ █▀▀ █▀▀█ ▀█░█▀ █▀▀ █▀▀█  
  3.                          ▒█▀▀▀ █░▀░█ █░░█ ░▀▀▀▄▄ █▀▀ █▄▄▀ ░█▄█░ █▀▀ █▄▄▀  
  4.                          ▒█▄▄▄ ▀░░░▀ ░▀▀▀ ▒█▄▄▄█ ▀▀▀ ▀░▀▀ ░░▀░░ ▀▀▀ ▀░▀▀    
  5.                      
  6.                                   ██████╗ ██████╗ ██████╗ ███████╗            
  7.                                  ██╔════╝██╔═══██╗██╔══██╗██╔════╝            
  8.                                  ██║     ██║   ██║██████╔╝█████╗            
  9.                                  ██║     ██║   ██║██╔══██╗██╔══╝            
  10.                                  ╚██████╗╚██████╔╝██║  ██║███████╗            
  11.                                   ╚═════╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝
  12.                      
  13.                             EmuServers WoW Creado por Kusanagy Azakura*
  14.  Ejecute el SQL En Auth /  puedes cambiar los ID de los buffos a tu gusto desde la tabla.
  15.  
  16.  /*
  17. Navicat MySQL Data Transfer
  18. Source Host     : localhost:3306
  19. Source Database : auth
  20. Target Host     : localhost:3306
  21. Target Database : auth
  22. Date: 1/31/2017 2:51:43 AM
  23. */
  24.  
  25. SET FOREIGN_KEY_CHECKS=0;
  26. -- ----------------------------
  27. -- Table structure for Custom_Buff
  28. -- ----------------------------
  29. DROP TABLE IF EXISTS `Custom_Buff`;
  30. CREATE TABLE `Custom_Buff` (
  31.   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  32.   `entry` int(11) DEFAULT '0',
  33.   PRIMARY KEY (`id`)
  34. ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
  35.  
  36. -- ----------------------------
  37. -- Records of buff_vip
  38. -- ----------------------------
  39. INSERT INTO `Custom_Buff` VALUES ('1', '15366');
  40. INSERT INTO `Custom_Buff` VALUES ('2', '16609');
  41. INSERT INTO `Custom_Buff` VALUES ('3', '48162');
  42. INSERT INTO `Custom_Buff` VALUES ('4', '48074');
  43. INSERT INTO `Custom_Buff` VALUES ('5', '48170');
  44. INSERT INTO `Custom_Buff` VALUES ('6', '43223');
  45. INSERT INTO `Custom_Buff` VALUES ('7', '36880');
  46. INSERT INTO `Custom_Buff` VALUES ('8', '467');
  47. INSERT INTO `Custom_Buff` VALUES ('9', '69994');
  48. INSERT INTO `Custom_Buff` VALUES ('10', '33081');
  49. INSERT INTO `Custom_Buff` VALUES ('11', '24705');
  50. INSERT INTO `Custom_Buff` VALUES ('12', '26035');
  51. INSERT INTO `Custom_Buff` VALUES ('13', '48469');
  52.  
  53. --]]
  54.  
  55. local function BuffOnChat(event, player, msg, _, lang)
  56.     if (msg == "#buff") then  -- Use #buff
  57.         local result = AuthDBQuery("SELECT id,Entry FROM Custom_Buff")
  58.         repeat
  59.         local id = result:GetString(0);
  60.         local Entry = result:GetUInt32(1);
  61.             player:AddAura(Entry, player)      
  62.         until not result:NextRow() 
  63.     player:SendBroadcastMessage("You have buffed, enjoy!")
  64.     end
  65. end
  66.  
  67. RegisterPlayerEvent(18, BuffOnChat)
Advertisement
Add Comment
Please, Sign In to add comment