Improve house system

This commit is contained in:
hydrant
2019-07-30 13:18:09 +02:00
parent 29d15976b2
commit 6cd026f390
3 changed files with 4 additions and 5 deletions

View File

@@ -36,7 +36,6 @@ export default function house(globalData: GlobalData) {
houseMenu = new Menu("Hausverwaltung", subTitle, new Point(50, 50), null, null);
globalData.InMenu = true;
mp.gui.chat.push(houseState.toString());
var rentInItem: UIMenuItem;
var cancelOwnRentalItem: UIMenuItem;
@@ -49,17 +48,14 @@ export default function house(globalData: GlobalData) {
var houseRentals = houseData.Rentals.length;
if (houseState === -1) { // Keine Beziehung zum Haus
mp.gui.chat.push("einmieten");
rentInItem = new UIMenuItem("Einmieten", "Miete dich in das Haus ein");
rentInItem.SetRightLabel(moneyFormat(houseData.RentalFee.toString(), 0));
rentInItem.SetRightLabel(moneyFormat(houseData.RentalFee.toString(), 0) + "$");
houseMenu.AddItem(rentInItem);
} else if (houseState === 0) { // Haus hat keinen Eigentümer
mp.gui.chat.push("kaufen");
buyHouseItem = new UIMenuItem("Haus kaufen", "Kaufe das Haus");
buyHouseItem.SetRightLabel(moneyFormat(houseData.Price, 0) + "$");
houseMenu.AddItem(buyHouseItem);
} else if (houseState === 1) { // Hausbesitzer
mp.gui.chat.push("besitzer");
setRentalFeeItem = new UIMenuItem("Miete setzen", "Setze den Mietpreis");
setRentalFeeItem.SetRightLabel(moneyFormat(houseData.RentalFee, 0) + "$");
houseMenu.AddItem(setRentalFeeItem);

View File

@@ -2576,6 +2576,7 @@ namespace ReallifeGamemode.Server.Commands
{
HouseManager.ReloadAllHouses();
player.SendNotification("Alle Häuser wurden neu geladen");
return;
}
player.SendChatMessage("~m~Benutzung: ~s~/house [add / remove / price / type / reloadhouses]");

View File

@@ -278,6 +278,8 @@ namespace ReallifeGamemode.Server.Managers
dbContext.HouseRentals.Remove(rental);
dbContext.SaveChanges();
target.Client?.SendNotification($"~y~{player.Name}~s~ hat deinen Mietvertrag ~g~gekündigt~s~.");
player.SendNotification("Du hast dem Spieler ~y~" + target.Name + "~s~ den Mietvertrag gekündigt.");
SendClientHouseData(player, house);
}