-
-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: simplify functions and fix some bugs
- Loading branch information
Showing
6 changed files
with
105 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
local sellHouse = TalkAction("/gotohouse") | ||
|
||
function sellHouse.onSay(player, words, param) | ||
local targetPlayer = Player(param) | ||
if targetPlayer then | ||
local targetHouse = targetPlayer:getHouse() | ||
if not targetHouse then | ||
targetPlayer:sendCancelMessage(string.format("The player %s not have house.", player:getName())) | ||
return | ||
end | ||
|
||
targetPlayer:teleportTo(targetHouse:getExitPosition()) | ||
return true | ||
else | ||
local house = player:getHouse() | ||
if not house then | ||
player:sendCancelMessage("You not have house. For goto house of one player use the player name param, usage: /gotohouse playername") | ||
return | ||
end | ||
|
||
player:teleportTo(house:getExitPosition()) | ||
return true | ||
end | ||
|
||
return false | ||
end | ||
|
||
sellHouse:separator(" ") | ||
sellHouse:groupType("god") | ||
sellHouse:register() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters