Advertisement
Guest User

leavehouse

a guest
Aug 17th, 2012
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. function onSay(cid, words, param, channel)
  2.     local house = getHouseFromPos(getCreaturePosition(cid))
  3.     if(not house) then
  4.         doPlayerSendCancel(cid, "You are not inside a house.")
  5.         doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
  6.         return false
  7.     end
  8.  
  9.     local owner = getHouseInfo(house).owner
  10.     if(owner ~= getPlayerGUID(cid) and (owner ~= getPlayerGuildId(cid) or getPlayerGuildLevel(cid) ~= GUILDLEVEL_LEADER)) then
  11.         doPlayerSendCancel(cid, "You are not the owner of this house.")
  12.         doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
  13.         return false
  14.     end
  15.  
  16.     setHouseOwner(house, 0)
  17.     doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
  18.     return false
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement