123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744 |
- msg("dev", "§bAmbientmusic §7v1.3.2 §rwurde geladen.");
- COMMAND_NAME = "ambientmusic";
- GMAP_PREFIX = "ambient_";
- QUEUE_TIMEOUT = 1200;
- AUTOPLAY_INTERVAL = 150;
- CLEANUP_INTERVAL = 18000;
- if (!command.exists(COMMAND_NAME)) {
- command.add(COMMAND_NAME);
- }
- event.load("custom_command");
- table.new(queue, 3);
- map.new(cooldown_end);
- map.new(last_hotspot);
- list.new(valid_options);
- list.add(valid_options, "sound");
- list.add(valid_options, "position");
- list.add(valid_options, "volume");
- list.add(valid_options, "radius");
- list.add(valid_options, "duration");
- list.add(valid_options, "repeat");
- list.add(valid_options, "active");
- map.new(defaults);
- map.add(defaults, "volume", 1.0);
- map.add(defaults, "radius", 1.0);
- map.add(defaults, "repeat", false);
- list.new(hotspots);
- gmap.toTable(ambient_sound_table, concat(GMAP_PREFIX, "sound"));
- for (index, 0, table.getSize(ambient_sound_table) - 1, 1) {
- list.add(hotspots, table.get(ambient_sound_table, index, 0));
- }
- sgoto(1, "autoplay");
- sgoto(76, "cleanup");
- @wait
- wait();
- /**********************************************************************************************************************
- * Command Evaluation *
- **********************************************************************************************************************/
- if (event == "custom_command" && command == COMMAND_NAME) {
- if (!(perm.has(player, "isTeam"))) {
- player.speak(player, "§6Commands", "Dir fehlen die Berechtigungen dazu");
- goto("wait");
- }
- size = list.getSize(args);
- if (size == 1) {
- arg0 = list.getIndex(args, 0);
- if (arg0 == "stop") {
- stopsound(player);
- player.speak(player, "§bAmbient", "Stopping all music...");
- goto("wait");
- }
- if (arg0 == "confirm") {
- index = table.getIndexOf(queue, player);
- if (index == -1) {
- player.speak(player, "§bAmbient", "Nothing to confirm.");
- goto("wait");
- }
- action = table.get(queue, index, 1);
- value = table.get(queue, index, 2);
-
- if (action == "remove") {
- player.speak(player, "§bAmbient", "Hotspot successfully removed.");
- print_hotspot(player, value);
-
- for (index_valid_options, 0, list.getSize(valid_options) - 1, 1) {
- remove(value, list.getIndex(valid_options, index_valid_options));
- }
- list.remove(hotspots, value);
-
- table.set(queue, index, 0, null);
- table.set(queue, index, 1, "none");
-
- goto("wait");
- }
-
- player.speak(player, "§bAmbient", "An error has occurred, please report to the developers.");
- assert(false);
- goto("wait");
- }
- if (arg0 == "cancel") {
- index = table.getIndexOf(queue, player);
- if (index == -1) {
- player.speak(player, "§bAmbient", "Nothing to cancel.");
- goto("wait");
- }
- action = table.get(queue, index, 1);
- value = table.get(queue, index, 2);
-
- if (action == "remove") {
- table.set(queue, index, 0, null);
- table.set(queue, index, 1, "none");
-
- player.speak(player, "§bAmbient", "Removal of '", value, "' canceled.");
- goto("wait");
- }
-
- player.speak(player, "§bAmbient", "An error has occurred, please report to the developers.");
- assert(false);
- goto("wait");
- }
- if (arg0 == "list") {
- if (list.getSize(hotspots) == 0) {
- player.speak(player, "§bAmbient", "There are no hotspots.");
- goto("wait");
- }
- player.speak(player, "§bAmbient", "Hotspots:");
- for (index_hotspots, 0, list.getSize(hotspots) - 1, 1) {
- msg(player, " - ", list.getIndex(hotspots, index_hotspots));
- }
- goto("wait");
- }
- }
- if (size == 2) {
- arg0 = list.getIndex(args, 0);
- arg1 = list.getIndex(args, 1);
- if (arg0 == "play") {
- playsound(player, arg1);
- player.speak(player, "§bAmbient", "Playing '", arg1, "'...");
- goto("wait");
- }
- if (arg0 == "stop") {
- stopsound(player, "master", arg1);
- player.speak(player, "§bAmbient", "Stopping '", arg1, "'...");
- goto("wait");
- }
- if (arg0 == "remove") {
- if (table.getIndexOf(queue, player) != -1) {
- player.speak(player, "§bAmbient", "Unconfirmed action remaining! Please confirm or cancel first.");
- goto("wait");
- }
- if (!list.contains(hotspots, arg1)) {
- player.speak(player, "§bAmbient", "'", arg1, "' does not exist.");
- goto("wait");
- }
- table.setSortColumn(queue, 2);
- hotspot_index = table.getIndexOf(queue, arg1);
- table.setSortColumn(queue, 0);
- if (hotspot_index != -1) {
- player.speak(player, "§bAmbient", "Another player is currently modifying '", arg1, "'.");
- goto("wait");
- }
- table.addRow(queue, player, "remove", arg1);
- sgoto(QUEUE_TIMEOUT, "queue");
- player.speak(player, "§bAmbient", "Do you really want to remove '", arg1, "'?");
- msg(player, concat("Please confirm with §b/", COMMAND_NAME, " confirm§r."));
- goto("wait");
- }
- if (arg0 == "get") {
- if (!list.contains(hotspots, arg1)) {
- player.speak(player, "§bAmbient", "'", arg1, "' does not exist.");
- goto("wait");
- }
-
- print_hotspot(player, arg1);
- goto("wait");
- }
- if (arg0 == "test") {
- if (!list.contains(hotspots, arg1)) {
- player.speak(player, "§bAmbient", "'", arg1, "' does not exist.");
- goto("wait");
- }
-
- hotspot_sound = fast_load(arg1, "sound");
- hotspot_position = read.location(fast_load(arg1, "position"));
- hotspot_volume = fast_load(arg1, "volume");
- hotspot_radius = fast_load(arg1, "radius");
- hotspot_duration = fast_load(arg1, "duration");
- last = map.get(last_hotspot, player);
- if (last != null) {
- stopsound(player, "master", fast_load(last, "sound"));
- }
- playsound(player, hotspot_sound, hotspot_position, "master", hotspot_volume);
- map.add(cooldown_end, player, time.getMillis() + (hotspot_duration * 1000));
- map.add(last_hotspot, player, arg1);
- player.speak(player, "§bAmbient", " Successfully executed ", arg1, " unconditionally.");
- goto("wait");
- }
- }
- if (size == 3) {
- arg0 = list.getIndex(args, 0);
- arg1 = list.getIndex(args, 1);
- arg2 = list.getIndex(args, 2);
- if (arg0 == "play") {
- playsound(player, arg1, entity.getLocation(player), "master", arg2);
- player.speak(player, "§bAmbient", "Playing '", arg1, "'...");
- goto("wait");
- }
- if (arg0 == "set") {
- if (!list.contains(hotspots, arg1)) {
- player.speak(player, "§bAmbient", "'", arg1, "' does not exist.");
- goto("wait");
- }
- if (arg2 == "position") {
- location = entity.getLocation(player);
- old = load(arg1, arg2);
- save(arg1, arg2, text.locationBlock(location));
- print_result(player, arg1, arg2, location, old);
- goto("wait");
- }
- }
- if (arg0 == "get") {
- if (!list.contains(hotspots, arg1)) {
- player.speak(player, "§bAmbient", "'", arg1, "' does not exist.");
- goto("wait");
- }
- if (!list.contains(valid_options, arg2)) {
- player.speak(player, "§bAmbient", "Option '", arg2, "' is invalid.");
- goto("wait");
- }
-
- value = load(arg1, arg2);
- if (value == null) {
- player.speak(player, "§bAmbient", "No value set for ", arg2, " of ", arg1, ". Default value: '", format_if_required(map.get(defaults, arg2)), "'");
- } else {
- player.speak(player, "§bAmbient", "Value for ", arg2, " of ", arg1, " is '", format_if_required(value), "'.");
- }
- goto("wait");
- }
- if (arg0 == "reset") {
- if (!list.contains(hotspots, arg1)) {
- player.speak(player, "§bAmbient", "'", arg1, "' does not exist.");
- goto("wait");
- }
- if (!list.contains(valid_options, arg2)) {
- player.speak(player, "§bAmbient", "Option '", arg2, "' is invalid.");
- goto("wait");
- }
- if (!map.contains(defaults, arg2)) {
- player.speak(player, "§bAmbient", "Option for ", arg2, " cannot be reset.");
- goto("wait");
- } else {
- old = load(arg1, arg2);
- remove(arg1, arg2);
- player.speak(player, "§bAmbient", "Reset ", arg2, " of ", arg1, " to ", format_if_required(map.get(defaults, arg2)), ". Previous value: '", format_if_required(old), "'.");
- goto("wait");
- }
- }
- }
- if (size == 4) {
- arg0 = list.getIndex(args, 0);
- arg1 = list.getIndex(args, 1);
- arg2 = list.getIndex(args, 2);
- arg3 = list.getIndex(args, 3);
- if (arg0 == "create") {
- if (list.contains(hotspots, arg1)) {
- player.speak(player, "§bAmbient", "'", arg1, "' does already exist.");
- goto("wait");
- }
- if (text.class(arg3) != "Fraction" && isLong(arg3)) {
- player.speak(player, "§bAmbient", "'", arg3, "' is not a whole number.");
- goto("wait");
- }
- save(arg1, "sound", arg2);
- save(arg1, "duration", arg3);
- save(arg1, "position", text.locationBlock(entity.getLocation(player)));
- save(arg1, "active", true);
-
- list.add(hotspots, arg1);
-
- player.speak(player, "§bAmbient", "Hotspot successfully created.");
- print_hotspot(player, arg1);
- goto("wait");
- }
- if (arg0 == "set") {
- if (!list.contains(hotspots, arg1)) {
- player.speak(player, "§bAmbient", "'", arg1, "' does not exist.");
- goto("wait");
- }
- if (!list.contains(valid_options, arg2)) {
- player.speak(player, "§bAmbient", "Option '", arg2, "' is invalid.");
- goto("wait");
- }
- if (arg2 == "sound") {
- old = load(arg1, arg2);
- save(arg1, arg2, arg3);
- print_result(player, arg1, arg2, arg3, old);
- goto("wait");
- }
- if (arg2 == "position") {
- if (is_location_string(arg3)) {
- old = load(arg1, arg2);
- save(arg1, arg2, text.locationBlock(location));
- print_result(player, arg1, arg2, location, old);
- } else {
- player.speak(player, "§bAmbient", "'", arg3, "' is not a location.");
- }
- goto("wait");
- }
- if (arg2 == "volume" || arg2 == "radius") {
- if (text.class(arg3) == "Fraction") {
- old = load(arg1, arg2);
- save(arg1, arg2, arg3);
- print_result(player, arg1, arg2, arg3, old);
- } else {
- player.speak(player, "§bAmbient", "'", arg3, "' is not a number.");
- }
- goto("wait");
- }
- if (arg2 == "duration") {
- if (text.class(arg3) == "Fraction" && isLong(arg3)) {
- old = load(arg1, arg2);
- save(arg1, arg2, arg3);
- print_result(player, arg1, arg2, arg3, old);
- } else {
- player.speak(player, "§bAmbient", "'", arg3, "' is not a whole number.");
- }
- goto("wait");
- }
- if (arg2 == "repeat" || arg2 == "active") {
- if (text.class(arg3) == "Boolean") {
- old = load(arg1, arg2);
- save(arg1, arg2, arg3);
- print_result(player, arg1, arg2, arg3, old);
- } else {
- player.speak(player, "§bAmbient", "'", arg3, "' is not a boolean.");
- }
- goto("wait");
- }
- }
- }
- if (size == 6) {
- arg0 = list.getIndex(args, 0);
- arg1 = list.getIndex(args, 1);
- arg2 = list.getIndex(args, 2);
- arg3 = list.getIndex(args, 3);
- arg4 = list.getIndex(args, 4);
- arg5 = list.getIndex(args, 5);
- if (arg0 == "set") {
- if (!list.contains(hotspots, arg1)) {
- player.speak(player, "§bAmbient", "'", arg1, "' does not exist.");
- goto("wait");
- }
- if (arg2 == "position") {
- if (text.class(arg3) == "Fraction" && text.class(arg4) == "Fraction" && text.class(arg5) == "Fraction") {
- location = loc.new(loc.getCoord(entity.getLocation(player), "w"), arg3, arg4, arg5);
- old = load(arg1, arg2);
- save(arg1, arg2, text.locationBlock(location));
- print_result(player, arg1, arg2, location, old);
- } else {
- player.speak(player, "§bAmbient", "'", arg3, "', '", arg4, "', '", arg4, "' are not all numbers.");
- }
- goto("wait");
- }
- }
- }
- if (size == 7) {
- arg0 = list.getIndex(args, 0);
- arg1 = list.getIndex(args, 1);
- arg2 = list.getIndex(args, 2);
- arg3 = list.getIndex(args, 3);
- arg4 = list.getIndex(args, 4);
- arg5 = list.getIndex(args, 5);
- arg6 = list.getIndex(args, 6);
- if (arg0 == "set") {
- if (!list.contains(hotspots, arg1)) {
- player.speak(player, "§bAmbient", "'", arg1, "' does not exist.");
- goto("wait");
- }
- if (arg2 == "position") {
- if (text.class(arg3) == "Fraction" && text.class(arg4) == "Fraction" && text.class(arg5) == "Fraction") {
- location = loc.new(arg6, arg3, arg4, arg5);
- old = load(arg1, arg2);
- save(arg1, arg2, text.locationBlock(location));
- print_result(player, arg1, arg2, location, old);
- } else {
- player.speak(player, "§bAmbient", "'", arg3, "', '", arg4, "', '", arg4, "' are not all numbers.");
- }
- goto("wait");
- }
- }
- }
- help(player);
- goto("wait");
- }
- goto("wait");
- @queue
- player = table.get(queue, 0, 0);
- action = table.get(queue, 0, 1);
- value = table.get(queue, 0, 2);
- if (action == "remove") {
- player.speak(player, "§bAmbient", "Removal of '", value, "' automatically aborted.");
- }
- table.removeRow(queue, 0);
- goto("wait");
- /**********************************************************************************************************************
- * Scheduled Loops *
- **********************************************************************************************************************/
- @autoplay
- for (index_hotspot, 0, list.getSize(hotspots) - 1, 1) {
- hotspot = list.getIndex(hotspots, index_hotspot);
- hotspot_active = fast_load(hotspot, "active");
- if (hotspot_active) {
- hotspot_sound = fast_load(hotspot, "sound");
- hotspot_position = read.location(fast_load(hotspot, "position"));
- hotspot_volume = fast_load(hotspot, "volume");
- hotspot_radius = fast_load(hotspot, "radius");
- hotspot_duration = fast_load(hotspot, "duration");
- hotspot_repeat = fast_load(hotspot, "repeat");
- players.near(near_players, hotspot_position, hotspot_radius);
- for (index_player, 0, list.getSize(near_players) - 1, 1) {
- player = list.getIndex(near_players, index_player);
- cooldown = map.getordefault(cooldown_end, player, 0);
- if (time.getMillis() >= cooldown) {
- last = map.get(last_hotspot, player);
- if (hotspot_repeat || last != hotspot) {
- if (last != null) {
- stopsound(player, "master", fast_load(last, "sound"));
- }
- playsound(player, hotspot_sound, hotspot_position, "master", hotspot_volume);
- map.add(cooldown_end, player, time.getMillis() + (hotspot_duration * 1000));
- map.add(last_hotspot, player, hotspot);
- }
- }
- }
- }
- }
- sgoto(AUTOPLAY_INTERVAL, "autoplay");
- goto("wait");
- @cleanup
- table.fromMap(cleanup_cooldown, cooldown_end);
- while (table.getSize(cleanup_cooldown) > 0) {
- if (time.getMillis() >= table.get(cleanup_cooldown, 0, 1)) {
- map.remove(cooldown_end, table.get(cleanup_cooldown, 0, 0));
- }
- table.removeRow(cleanup_cooldown, 0);
- }
- sgoto(CLEANUP_INTERVAL, "cleanup");
- goto("wait");
- /**********************************************************************************************************************
- * User-Interaction *
- **********************************************************************************************************************/
- function print_hotspot(player, name) { // (Player player, String name)
- player.speak(player, "§bAmbient", "Hotspot: ", name);
- for (index, 0, list.getSize(valid_options) - 1, 1) {
- option = list.getIndex(valid_options, index);
- msg(player, " ", option, " = ", format_if_required(load(name, option, concat(format_if_required(map.get(defaults, option)), " §7(default)"))));
- }
- }
- return;
- @print_result // (Player player, String name, String option, Object newValue, Object oldValue)
- // oldValue is optional
- // option: sound, position, volume, radius, duration, repeat, active
- push(size, player, name, option, newValue, oldValue);
- size = popArg();
- if (size > 4) {
- oldValue = popArg();
- } else {
- oldValue = null;
- }
- newValue = popArg();
- option = popArg();
- name = popArg();
- player = popArg();
- if (oldValue == null) {
- player.speak(player, "§bAmbient", "Set ", option, " of ", name, " to '", format_if_required(newValue), "'.");
- } else {
- player.speak(player, "§bAmbient", "Set ", option, " of ", name, " from '", format_if_required(oldValue), "' to '", format_if_required(newValue), "'.");
- }
- pop("size", "player", "name", "option", "newValue", "oldValue");
- return();
- @help // (Player player)
- push(size, player, optionList);
- popArg();
- player = popArg();
- option_list = list.getIndex(valid_options, 0);
- for ("index", 1, list.getSize(valid_options) - 1, 1) {
- option_list = concat(option_list, ", ", list.getIndex(valid_options, index));
- }
- player.speak(player, "§bAmbient", "/", COMMAND_NAME, " ...");
- msg(player, "§b - play <music> [volume]§r Spielt Musik testweise ab");
- msg(player, "§b - stop [music]§r Stoppt abspielende Musik");
- msg(player, "§b - create <name> <music> <duration>§r Neuer Ambiente-Hotspot");
- msg(player, "§b - remove <name>§r Löscht einen Ambiente-Hotspot");
- msg(player, "§b - list§r Gibt alle Ambiente-Hotspots");
- msg(player, "§b - get <name> [option]§r Gibt den Wert der Einstellung");
- msg(player, "§b - set <name> <option> <value>§r Ändert eine Einstellung");
- msg(player, "§b - set <name> position§r Setzt die Position auf die des Spielers");
- msg(player, "§b - set <name> position <x> <y> <z> [world]§r Setzt die Position");
- msg(player, "§b - reset <name> <option>§r Setzt eine Einstellung zurück");
- msg(player, "§b - test <name>§r Testet einen Ambiente-Hotspot");
- msg(player, "§bBekannte Einstellungen:§r ", option_list);
- pop("size", "player", "optionList");
- return();
- /**********************************************************************************************************************
- * Utility *
- **********************************************************************************************************************/
- @format_if_required // (Object object)
- push(size, object, world, x, y, z);
- popArg();
- object = popArg();
- if (object != null) {
- if (text.class(object) == "Fraction") {
- object = text.number(object);
- }
- if (is_location_string(object)) {
- object = read.location(object);
- }
- if (text.class(object) == "Location") {
- world = loc.getCoord(object, "w");
- x = math.roundComma(loc.getCoord(object, "x"), 2);
- y = math.roundComma(loc.getCoord(object, "y"), 2);
- z = math.roundComma(loc.getCoord(object, "z"), 2);
- object = concat("x=", text.number(x), " y=", text.number(y), " z=", text.number(z), " world=", world);
- }
- }
- pushArg(object);
- pop("size", "object", "world", "x", "y", "z");
- reset();
- return();
- @fast_load // (String name, String option)
- // option: sound, position, volume, radius, duration, repeat, active
- push(size, name, option, defaultValue, value);
- popArg();
- option = popArg();
- name = popArg();
- assert(list.contains(valid_options, option));
- defaultValue = map.get(defaults, option);
- value = load(name, option, defaultValue);
- pushArg(value);
- pop("size", "name", "option", "defaultValue", "value");
- reset();
- return();
- @load // (String name, String option, Object defaultValue)
- // defaultValue is optional
- // option: sound, position, volume, radius, duration, repeat, active
- push(size, name, option, defaultValue, value);
- size = popArg();
- if (size > 2) {
- defaultValue = popArg();
- } else {
- defaultValue = null;
- }
- option = popArg();
- name = popArg();
- assert(list.contains(valid_options, option));
- value = gmap.get(concat(GMAP_PREFIX, option), name);
- if (value == null) {
- pushArg(defaultValue);
- } else {
- pushArg(value);
- }
- pop("size", "name", "option", "defaultValue", "value");
- reset();
- return();
- @save // (String name, String option, Object value)
- // option: sound, position, volume, radius, duration, repeat, active
- push(size, name, option, value);
- popArg();
- value = popArg();
- option = popArg();
- name = popArg();
- assert(list.contains(valid_options, option));
- gmap.add(concat(GMAP_PREFIX, option), name, value);
- pop("size", "name", "option", "value");
- reset();
- return();
- @remove // (String name, String option)
- // option: sound, position, volume, radius, duration, repeat, active
- push(size, name, option);
- popArg();
- option = popArg();
- name = popArg();
- assert(list.contains(valid_options, option));
- gmap.remove(concat(GMAP_PREFIX, option), name);
- pop("size", "name", "option");
- reset();
- return();
- @is_location_string // (String location)
- push(size, location, result);
- popArg();
- location = popArg();
- try {
- read.location(location);
- result = true;
- } catch {
- result = false;
- }
- pushArg(result);
- pop("size", "location", "result");
- reset();
- return();
- /**********************************************************************************************************************
- * Commands *
- **********************************************************************************************************************/
- @playsound // (Player player, String sound, Location location, String channel, frac volume, frac pitch)
- // location, channel, volume and pitch are optional
- // channel: master, music, record, weather, block, hostile, neutral, player, ambient, voice
- push(size, player, sound, location, channel, volume, pitch, player_name, x, y, z);
- size = popArg();
- if (size > 5) {
- pitch = popArg();
- } else {
- pitch = 1.0;
- }
- if (size > 4) {
- volume = popArg();
- } else {
- volume = 1.0;
- }
- if (size > 3) {
- channel = popArg();
- } else {
- channel = "master";
- }
- if (size > 2) {
- location = popArg();
- sound = popArg();
- player = popArg();
- } else {
- sound = popArg();
- player = popArg();
- location = entity.getLocation(player);
- }
- player_name = entity.getName(player);
- x = text.number(loc.getCoord(location, "x"));
- y = text.number(loc.getCoord(location, "y"));
- z = text.number(loc.getCoord(location, "z"));
- command(concatspace("playsound", sound, channel, player_name, x, y, z, text.number(volume), text.number(pitch)));
- pop("size", "player", "sound", "location", "channel", "volume", "pitch", "player_name", "x", "y", "z");
- reset();
- return();
- @stopsound // (Player player, String channel, String sound)
- // channel and sound are optional
- // channel: master, music, record, weather, block, hostile, neutral, player, ambient, voice
- push(size, player, channel, sound, player_name);
- size = popArg();
- if (size == 3) {
- sound = popArg();
- channel = popArg();
- player = popArg();
- player_name = entity.getName(player);
- command(concatspace("stopsound", player_name, channel, sound));
- }
- if (size == 2) {
- channel = popArg();
- player = popArg();
- player_name = entity.getName(player);
- command(concatspace("stopsound", player_name, channel));
- }
- if (size == 1) {
- player = popArg();
- player_name = entity.getName(player);
- command("stopsound ", player_name);
- }
- push("size", "player", "channel", "sound", "player_name");
- reset();
- return();
|