Advertisement
blackwolfsden

GW Teleporter

Mar 19th, 2013
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.37 KB | None | 0 0
  1. -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  2. -- Guild House system teleporter
  3. -- by Grumbo/Blackwolf
  4. -- allows guild members to teleport to area flags owned by
  5. -- there guild.
  6. -- re-worked with advanced skills by Grandelf1 ty.
  7. -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  8. function Guildteleport(event, pPlayer, message, type, language)
  9.     local ChatMsg = ".gtele"
  10.     local startpos, endpos = string.find(message, ChatMsg)
  11.         if(startpos == 1) then
  12.             local text = message:gsub(ChatMsg, "")
  13.                 if(pPlayer:IsInGuild()==true)then
  14.                     local Loc = tonumber(text)
  15.                         if(GWARZ[Loc]==nil)then
  16.                             pPlayer:SendBroadcastMessage("|cffcc0000error.... teleport entry doesn't exsist.|r")
  17.                         return false;
  18.                         end
  19.                         if(GWARZ[Loc]~=nil)then
  20.                             if(GWARZ[Loc].Guildname~=pPlayer:GetGuildName())then
  21.                                 pPlayer:SendBroadcastMessage("Your guild doesn't own that area.")
  22.                                 pPlayer:SendBroadcastMessage("You cannot teleport there.")
  23.                             return false;
  24.                             end
  25.                             if(pPlayer:GetGuildName()==GWARZ[Loc].Guildname)then
  26.                                 pPlayer:Teleport(GWARZ[Loc].Mapid, GWARZ[Loc].X, GWARZ[Loc].Y, GWARZ[Loc].Z, 1.0)
  27.                                 pPlayer:SendBroadcastMessage("|cff00cc00Teleport complete.|r")
  28.                             return false;
  29.                             end
  30.                         return false;
  31.                         end
  32.                 return false;
  33.                 end
  34.         end
  35. end
  36. RegisterServerHook(16, "Guildteleport")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement