Advertisement
blackwolfsden

createing guild command entry

Jan 19th, 2014
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.81 KB | None | 0 0
  1. local LocId = GetLocationId(player) -- just need to probe for the table entry
  2.         if(LocId == nil)then -- GWCOMM[player:GetGuildName()].xxx_xxx is how this should pull together
  3.             LocId = CreateLocation(player:GetMapId(), player:GetAreaId(), player:GetZoneId())
  4.         end
  5.        
  6. local Gcommands = GetGuildCommand(player:GetGuildName())
  7.         if(Gcommands == nil)then
  8.             Gcommands = CreateGcommands(player:GetGuildName())
  9.         end
  10.  
  11. local function GetGcommands(guild)
  12.     for i = 1, #GCOMM do
  13.         if(GWARZ[i].guild == guild) then
  14.             return i;
  15.         end
  16.     end
  17. end
  18.  
  19. function CreateLocation(guild)
  20.     local CLentry = guild --(#GWCOMM+1) -- should create varchar entry of guild name
  21.     WorldDBQuery("INSERT INTO guild_warz.commands SET `guild` = '"..guild.."';");
  22.     LoadGWtable()
  23.     print("commands for: "..CLentry.." : created.")
  24.    
  25.     -- Push values to Table Update after creation
  26.     PreparedStatements(3, "commands", "commands", CLentry)
  27.     PreparedStatements(3, "info_loc", "info", CLentry)
  28.     PreparedStatements(3, "list_loc", "list", CLentry)
  29.     PreparedStatements(3, "Buy_loc", "buy area", CLentry)
  30.     PreparedStatements(3, "buy_house", "buy house", CLentry)
  31.     PreparedStatements(3, "buy_pig", "buy pig", CLentry)
  32.     PreparedStatements(3, "buy_guard", "buy guard", CLentry)
  33.     PreparedStatements(3, "sell_loc", "sell area", CLentry)
  34.     PreparedStatements(3, "sell_house", "sell house", CLentry)
  35.     PreparedStatements(3, "sell_pig", "sell pig", CLentry)
  36.     PreparedStatements(3, "sell_guard", "fire guard", CLentry)
  37.     PreparedStatements(3, "version", "ver", CLentry)
  38.     PreparedStatements(3, "GLD_lvlb", 0, CLentry)
  39.     PreparedStatements(3, "GLD_lvls", 0, CLentry)
  40.     PreparedStatements(3, "tele", "gtele", CLentry)
  41.     return CLentry;
  42. end
  43.  
  44. --[[
  45. local function PreparedStatements(key, ...)
  46.         [3] = "UPDATE guild_warz.commands SET `%s` = '%s' WHERE `entry` = '%s';",
  47. ]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement