73 lines
2.3 KiB
JavaScript
73 lines
2.3 KiB
JavaScript
// CREATE MENU ON TRIGGER
|
|
var torso = API.createMenu("Shirts", "Alle Shirts", 0, 0, 6);
|
|
torso.AddItem(API.createMenuItem("Weiter", "Speichert die ID"));
|
|
var lasttorso = 0;
|
|
for (var i = 0; i < 209; i++) {
|
|
torso.AddItem(API.createMenuItem("" + i, "Description " + i));
|
|
}
|
|
|
|
var undershirt = API.createMenu("Undershirt", "Alle undershirts", 0, 0, 6);
|
|
undershirt.AddItem(API.createMenuItem("Weiter", "Speichert die ID"));
|
|
var lastundershirt = 0;
|
|
for (var i = 0; i < 100; i++) {
|
|
undershirt.AddItem(API.createMenuItem("" + i, "Description " + i));
|
|
}
|
|
|
|
var torsofix = API.createMenu("Torsofix", "Alle Torsofixes", 0, 0, 6);
|
|
torsofix.AddItem(API.createMenuItem("Weiter", "Speichert die ID"));
|
|
var lasttorsofix = 0;
|
|
for (var i = 0; i < 100; i++) {
|
|
torsofix.AddItem(API.createMenuItem("" + i, "Description " + i));
|
|
}
|
|
|
|
API.onServerEventTrigger.connect(function (name, args) {
|
|
if (name == "createTorsoMenu") {
|
|
API.showCursor(false);
|
|
torso.Visible = true;
|
|
} else if (name == "pse") {
|
|
API.playScreenEffect(args[0], 10000, false);
|
|
}
|
|
});
|
|
|
|
//onItemSelect
|
|
|
|
torso.OnItemSelect.connect(function (sender, item, index) {
|
|
if (item.Text != "Weiter") {
|
|
API.triggerServerEvent("setTorso", item.Text);
|
|
lasttorso = item.Text;
|
|
} else {
|
|
API.sendChatMessage("Shirt : " + lasttorso)
|
|
API.triggerServerEvent("setTorso", lasttorso);
|
|
torso.Visible = false;
|
|
undershirt.Visible = true;
|
|
}
|
|
|
|
});
|
|
|
|
|
|
undershirt.OnItemSelect.connect(function (sender, item, index) {
|
|
if (item.Text != "Weiter") {
|
|
API.triggerServerEvent("setUnderShirt", item.Text);
|
|
lastundershirt = item.Text;
|
|
} else {
|
|
API.sendChatMessage("Undershirt : " + lastundershirt)
|
|
API.triggerServerEvent("setUnderShirt", lastundershirt);
|
|
undershirt.Visible = false;
|
|
torsofix.Visible = true;
|
|
}
|
|
|
|
});
|
|
|
|
torsofix.OnItemSelect.connect(function (sender, item, index) {
|
|
if (item.Text != "Weiter") {
|
|
API.triggerServerEvent("setTorsoFix", item.Text);
|
|
lasttorsofix = item.Text;
|
|
} else {
|
|
API.sendChatMessage("Torsofix : " + lasttorsofix)
|
|
API.triggerServerEvent("setTorsoFix", lasttorsofix);
|
|
torsofix.Visible = false;
|
|
API.sendChatMessage("Bitte gebe diese Daten einem Scripter/Programmierer!")
|
|
}
|
|
|
|
});
|
|
|