Clothe change, Wanted List Change

This commit is contained in:
kookroach
2021-04-04 14:48:55 +02:00
parent 64343fc640
commit 0b64eef183
3 changed files with 27 additions and 23 deletions

View File

@@ -26,25 +26,25 @@ const Color = NativeUI.Color;
export default function clotheShopList(globalData: IGlobalData) {
const categoryTitles = {
clothes: {
1: "Masks",
2: "Hair Styles",
3: "Torsos",
4: "Legs",
5: "Bags and Parachutes",
6: "Shoes",
1: "Masken",
2: "Haar Stil",
3: "Oberkörper",
4: "Hosen",
5: "Taschen und Fallschirme",
6: "Schuhe",
7: "Accessories",
8: "Undershirts",
9: "Body Armors",
9: "Schutzwesten",
10: "Decals",
11: "Tops"
11: "Oberteile"
},
props: {
0: "Hats",
1: "Glasses",
2: "Ears",
6: "Watches",
7: "Bracelets"
0: "Kopfbedeckungen",
1: "Brillen",
2: "Ohrringe",
6: "Uhren",
7: "Armbänder"
}
};
@@ -158,12 +158,12 @@ export default function clotheShopList(globalData: IGlobalData) {
return;
}
}
mainMenu.AddItem(new UIMenuItem(categoryTitles[type][key], `${type === "props" ? "Prop category." : "Clothing category."}`));
mainMenu.AddItem(new UIMenuItem(categoryTitles[type][key], `${type === "props" ? " " : " "}`));
// Create category menu
categoryMenu = new UIMenu("", categoryTitles[type][key].toUpperCase(), new Point(0, 0), bannerSprite.library, bannerSprite.texture);
categoryMenu.Visible = false;
} else {
mainMenu.AddItem(new UIMenuItem(categoryTitles[type][key], `${type === "props" ? "Prop category." : "Clothing category."}`));
mainMenu.AddItem(new UIMenuItem(categoryTitles[type][key], `${type === "props" ? " " : " "}`));
// Create category menu
categoryMenu = new UIMenu("", categoryTitles[type][key].toUpperCase(), new Point(0, 0), bannerSprite.library, bannerSprite.texture);
categoryMenu.Visible = false;
@@ -175,24 +175,28 @@ export default function clotheShopList(globalData: IGlobalData) {
for (const item of value) {
if (item.ComponentId == key) {
var txData = getClothingName(key, item.ClotheId, gender);
let clotheUpperMenu = new UIMenu(mp.game.ui.getLabelText(txData[0].data[0].GXT), " ", new Point(0, 0), bannerSprite.library, bannerSprite.texture);
clotheUpperMenu.Visible = false;
for (const x of txData) {
var itemDescription = (key === 11 ? mp.game.ui.getLabelText(x.undershirt[1].GXT) : "Clothing item.");
var itemDescription = (key === 11 ? mp.game.ui.getLabelText(x.undershirt[1].GXT) : " ");
//var itemDescription = (key === 11 ? x.undershirt[1].GXT + " - " + x.id: "Clothing item.");
if (itemDescription == "NULL") {
itemDescription = "Clothing item.";
itemDescription = "";
}
const tempItem = new UIMenuItem(mp.game.ui.getLabelText(x.data[0].GXT), itemDescription);
//const tempItem = new UIMenuItem(x.data[0].GXT + " - " + x.id , itemDescription);
tempItem.SetRightLabel(`${item.Price > 0 ? `$${item.Price}` : "FREE"}`);
tempItem.SetRightLabel(`${item.Price > 0 ? `$${item.Price}` : "KOSTENLOS"}`);
categoryMenu.AddItem(tempItem);
clotheUpperMenu.AddItem(tempItem);
cloth.push(item);
tx.push(x);
}
categoryMenu.AddItem(clotheUpperMenu);
}
}

View File

@@ -169,7 +169,6 @@ export default function (globalData: IGlobalData) {
} else if (item === payItem) {
mp.gui.chat.activate(true);
mp.gui.cursor.show(true, true);
globalData.InMenu = true;
var input = new InputHelper("Welchem Spieler möchtest du Geld geben (Name / ID)?", globalData);
input.show();
input.getValue(name => {

View File

@@ -796,14 +796,15 @@ namespace ReallifeGamemode.Server.Managers
if (!player.IsLoggedIn()) return;
List<Player> players = NAPI.Pools.GetAllPlayers();
var listPlayers = players.Select(p => new
var listPlayers = players.Where(p => p.GetUser().Wanteds > 0)
.Select(p => new
{
Id = p.Handle.Value,
p.Name,
wanted = p.GetUser().Wanteds,
}) ;
});
if(listPlayers.Count() > 0)
if (listPlayers.Count() > 0)
player.TriggerEvent("showWantedlist", JsonConvert.SerializeObject(listPlayers));
else
player.SendNotification("~r~[Fehler] ~w~Es gibt derzeitig keine Verbrecher!");