Staff Pick: Teams
By
MwthornCreated: 2016/02/11 14:56:45 UTC-08:00 (8 years and 316 days ago)
Edited: 2016/09/15 02:53:59 UTC-07:00 (8 years and 99 days ago)
Likes: 1
Staff pick as of: 2016/02/11 14:58:26 UTC-08:00 (8 years and 316 days ago)
Denizen Version: 0.9.7-SNAPSHOT (Build 460)
Script Version: 3
Description:
Teams created by Mwthorn
Created your own teams and parties. Manage your team with a shared bank and stats to show-off in top ranks.
Friendlyfire is off and there is included a fancy menu system if you also install another script called ThornChat (I'll get that on later)
This script also includes a language config to easily fit in for your language on your server! You can also specefy other stuff such as maximum members on each team.
This is just a start-up version, but I'll hopefully (eventually) add a few more features and fixes here and there.
Credits to both Blackcoyote and Fortifier for helping out :)
1.1 Changes:
- Fixed a BUNCH of stuff, more like it now should work.
- Now includes a menu with /team
- Promote, rename, top and kick commands added
- Rank kills/color-system (kills to get a higher rank)
3 Changes:
- Added webget update
- Added hotfixes and bug fixes
Download script |
View raw script### Flags
# Teams_Groups:
# Teams_Group_Name_Kills:
# Teams_Group_Name_Deaths:
# Teams_Group_Name_Rank:
# Teams_Group_Name_Members:
# Teams_Group_Name_Leaders:
# Teams_Group_Name_Created:
# Teams_Group_Name_Bank:
# Teams_Player_Group:
# Teams_Player_Menu_Respond:
# Teams_Player_Pending:
# Teams_Player_Chat:
# <s@Teams_Data.yaml_key[config.ranks.color.1]>
Teams_Version:
type: version
name: Teams
id: 87
description: Allows teaming up with other players.
version: 3
Teams_Data:
type: yaml data
config:
ranks:
kills:
"1": 500
"2": 1250
"3": 2000
"4": 10000
"5": 50000
"6": 100000
colors:
"1": "&7"
"2": "&9"
"3": "&6"
"4": "&b"
"5": "&a"
"6": "&c"
chat_system: "true"
# TODO
namemaxlength: 10
nameminlength: 2
maxmembers: 8
commands:
main: "team"
args:
help: "help"
create: "create"
info: "info"
leave: "leave"
top: "top"
accept: "accept"
deny: "deny"
invite: "invite"
deposit: "deposit"
withdraw: "withdraw"
rename: "rename"
promote: "promote"
kick: "kick"
args_descriptions:
help: "Shows commands for teams."
create: "(name) Creates a new team."
info: "(name/lpayer) Shows information about a team."
leave: "Leaves the team you are in."
top: "Shows a list of top teams."
accept: "Accepts an invitation from a team."
deny: "Declines an invitation from a team."
invite: "(player) Invites a player."
deposit: "(money) Puts money into your team-bank"
withdraw: "(money) Takes money from your team-bank"
rename: "(new name) Changes your team name."
promote: "(player) Gives player leader promotion."
kick: "(player) Kick a player from your team."
lang:
# Titles
help_title: "Team Information"
yourteam_title: "Your Team"
# Error messages
alreadyonteam: "is already on a team!"
noteam: "Is not on any team!"
unknown: "Unknown command!"
missargs: "Not enugh arguements!"
teamalreadyexist: "already exists!"
noteamfound: "No team was found!"
nolistteam: "There are no teams!"
teamfull: "cannot have more members!"
nopending: "have not been invited to any team!"
alreadypending: "already have an invitation!"
notenoughmoney: "do not have enough money!"
notvalid: "This command is not correct!"
nametoolong: "Name is too long!"
nametooshort: "Name is too short!"
nonegative: "No negative numbers!"
notyourside: "is not on your team!"
alreadyleader: "is already a leader!"
cannotkickleader: "cannot kick a leader!"
noleader: "is not a leader!"
spamming: "Cooldown command, wait"
noplayerfound: "No player was found!"
# You
you: "You"
# Announces
newteam: "has created a new team called"
teamdisband1: "Team"
teamdisband2: "was disbanded by"
renamedteam1: "changed team-name from"
renamedteam2: "to"
# Info
teamtotal: "Team Total"
kills: "Kills"
deaths: "Deaths"
kdr: "KDR"
teambank: "Team Bank"
teamrank: "Team Rank"
level: "Level"
members: "Members"
leaders: "Leaders"
created: "Team created"
nextrank: "Next Rank"
moreinfo: "For more information, write"
# messages
leftteam: "left team"
invited: "on your team invited"
invitedtoteam: "have been invited to team"
declinedpending: "declined the invitation to"
acceptedpending: "became a member of"
moneydeposit1: "deposited"
moneydeposit2: "to your team bank"
moneywithdraw1: "took"
moneywithdraw2: "from your team bank"
menufinalstep: "Write the last argument for your command."
promoted: "gave leadership to"
waskicked1: "kick"
waskicked2: "out of"
gotkicked: "were kicked out of"
teamrankup: "Your team is now rank"
# top
toptitle: "Top Teams"
topkdr: "KDR"
topupdate: "Updating list..."
Teams_Help_List:
type: task
debug: false
script:
- narrate "<&9>--- <&d><s@Teams_Data.yaml_key[config.lang.help_title]> <&9>---"
- foreach <s@Teams_Data.list_keys[config.commands.args]> {
- narrate "<&6>/<s@Teams_Data.yaml_key[config.commands.main]> <s@Teams_Data.yaml_key[config.commands.args.<def[value]>]> <&8>- <&b><s@Teams_Data.yaml_key[config.commands.args_descriptions.<def[value]>]>"
}
Teams_Help_Message:
type: procedure
debug: false
script:
- determine "<&b>/<s@Teams_Data.yaml_key[config.commands.main]> <s@Teams_Data.yaml_key[config.commands.args.help]>"
Teams_Events:
type: world
debug: false
events:
on system time hourly:
- webget "http://stats.denizenscript.com/tracker?script=<s@Teams_Version.yaml_key[id]>&version=<s@Teams_Version.yaml_key[version]>"
on player death:
- if <player.has_flag[Teams_Player_Group]> {
- define flag2 "Teams_Group_<player.flag[Teams_Player_Group]>_Deaths"
- flag server "<def[flag2]>:++"
}
- if <context.damager.is_player||false> {
- run Teams_Kills player:<context.damager> instantly
}
else if <context.damager.shooter.is_player||false> {
- run Teams_Kills player:<context.damager.shooter> instantly
}
on player damaged:
- if <context.cause> != ENTITY_ATTACK {
- if <context.cause> != PROJECTILE {
- queue clear
}
}
- if <context.entity.is_player||false> {
- define player <context.entity>
- inject Teams_FriendlyFire
}
else if <context.projectile.shooter.is_player||false> {
- define player <context.projectile.shooter>
- inject Teams_FriendlyFire
}
on player clicks in Teams_Menu:
- determine cancelled passively
- inventory close d:<context.inventory>
- if <context.item.scriptname||false> == "Teams_Close" {
- queue clear
}
- define title <context.item.display_name.after[<&l>]>
- if <context.item.lore.get[1].starts_with[<&b>(]> {
- flag player Teams_Player_Menu_Respond:<def[title]>
- narrate "<&a><s@Teams_Data.yaml_key[config.lang.menufinalstep]> <&b>/<s@Teams_Data.yaml_key[config.commands.main]> <def[title]> (*)"
- queue clear
}
- execute as_player "<s@Teams_Data.yaml_key[config.commands.main]> <def[title]>"
on player drags in Teams_Menu:
- determine cancelled
on player drags in Teams_Menu_v2:
- determine cancelled
on player clicks in Teams_Menu_v2:
- determine cancelled passively
- inventory close d:<context.inventory>
Teams_Kills:
type: task
debug: false
script:
## HOTFIX
- if <player.has_flag[Teams_Player_Group]> {
- define flag Teams_Group_<player.flag[Teams_Player_Group]>_Kills
- if <server.has_flag[<def[flag]>].not||true> {
- announce "<&c><player.name> har <player.flag[Teams_Player_Group]> som ikke findes!" to_flagged:Show_Errors
- flag player Teams_Player_Group:!
}
}
##
- if <player.has_flag[Teams_Player_Group]> {
- define flag1 "Teams_Group_<player.flag[Teams_Player_Group]>_Kills"
- flag server "<def[flag1]>:++"
- if <server.flag[Teams_Group_<player.flag[Teams_Player_Group]>_Rank]> < <s@Teams_Data.list_keys[config.ranks.kills].size> {
- if <server.flag[<def[flag1]>].round> >= <s@Teams_Data.yaml_key[config.ranks.kills.<server.flag[Teams_Group_<player.flag[Teams_Player_Group]>_Rank]>].round> {
- define flag Teams_Group_<player.flag[Teams_Player_Group]>_Rank
- flag server "<def[flag]>:<server.flag[Teams_Group_<player.flag[Teams_Player_Group]>_Rank].add_int[1]>"
- define flag "Teams_Group_<player.flag[Teams_Player_Group]>_Members"
- define text1 "<s@Teams_Data.yaml_key[config.ranks.colors.<server.flag[Teams_Group_<player.flag[Teams_Player_Group]>_Rank]>].parse_color>"
- define text2 "<server.flag[Teams_Group_<player.flag[Teams_Player_Group]>_Rank]>"
- announce "<&b><player.flag[Teams_Player_Group]> <&3><s@Teams_Data.yaml_key[config.lang.teamrankup]> <def[text1]><def[text2]>"
}
}
}
Teams_FriendlyFire:
type: task
debug: false
script:
- if <player.has_flag[Teams_Player_Group]> && <def[player].as_player.has_flag[Teams_Player_Group]> {
- if <player.flag[Teams_Player_Group]> == <def[player].as_player.flag[Teams_Player_Group]> {
- determine CANCELLED
}
}
Teams_Command:
type: command
name: team
description: Commands for teams.
usage: /<s@Teams_Data.yaml_key[config.commands.main]>
debug: false
aliases:
- <s@Teams_Data.yaml_key[config.commands.main]>
# permission: ggpvp.teams
# permission message: Sorry, <player.name>, you don't have the permission '<permission>'!
script:
## HOTFIX
- if <player.has_flag[Teams_Player_Group]> {
- define flag Teams_Group_<player.flag[Teams_Player_Group]>_Members
- if <server.has_flag[<def[flag]>].not||true> {
- announce "<&c><player.name> har <player.flag[Teams_Player_Group]> som ikke findes!" to_flagged:Show_Errors
- flag player Teams_Player_Group:!
}
else if <server.flag[<def[flag]>].as_list.contains[<player>].not||true> {
- announce "<&c><player.name> har <player.flag[Teams_Player_Group]> som ikke findes!" to_flagged:Show_Errors
- flag player Teams_Player_Group:!
}
}
##
- if <context.args.size> > 0 {
# Help
- if <context.args.get[1]> == "<s@Teams_Data.yaml_key[config.commands.args.help]>" {
- inject Teams_Help_List
}
# Create
else if <context.args.get[1]> == "<s@Teams_Data.yaml_key[config.commands.args.create]>" {
- if <player.has_flag[Teams_Player_Spam]||true> {
- narrate "<s@Teams_Data.yaml_key[config.lang.spamming]> <player.flag[Teams_Player_Spam].expiration.formatted>"
- queue clear
}
- if <context.args.size> >= 2 {
- define team "<context.args.get[2]>"
- if <player.has_flag[Teams_Player_Group]||true> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.alreadyonteam]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <server.has_flag[Teams_Group_<def[team]>_Created]||true> {
- narrate "<&c><def[team]> <s@Teams_Data.yaml_key[config.lang.teamalreadyexist]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <def[team].length> > <s@Teams_Data.yaml_key[config.namemaxlength]> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.nametoolong]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <def[team].length> < <s@Teams_Data.yaml_key[config.nameminlength]> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.nametooshort]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <def[team].contains_any[*|?|,|.|!|(|)|/|#|¤|%|&|/|<&nl>|<&>|<&cm>|<&ss>|<&sq>|<&sp>|< >|<&dq>|<&co>|<&sc>|<&rb>|<&lb>|<&rc>|<&lc>|<&ns>|<&pc>|<&pipe>|<&ds>|<<>|<>>|<&bs>|<&at>|<&dot>]||true> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.notvalid]> <proc[Teams_Help_Message]>"
- queue clear
}
- flag player Teams_Player_Spam:True duration:30s
# Create Team
- flag player Teams_Player_Group:<def[team]>
- define flag "Teams_Group_<def[team]>_Kills"
- flag server "<def[flag]>:0"
- define flag "Teams_Group_<def[team]>_Deaths"
- flag server "<def[flag]>:0"
- define flag "Teams_Group_<def[team]>_Bank"
- flag server "<def[flag]>:0"
- define flag "Teams_Group_<def[team]>_Rank"
- flag server "<def[flag]>:1"
- define flag "Teams_Group_<def[team]>_Members"
- flag server "<def[flag]>:|:<player>"
- define flag "Teams_Group_<def[team]>_Leaders"
- flag server "<def[flag]>:|:<player>"
- define flag "Teams_Group_<def[team]>_Created"
- flag server "<def[flag]>:<util.date.time.day>-<util.date.time.month>-<util.date.time.year>"
- flag server Teams_Groups:->:<def[team]>
- announce "<&b><player.name> <&3><s@Teams_Data.yaml_key[config.lang.newteam]> <&b><def[team]>"
}
else {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.missargs]> <proc[Teams_Help_Message]>"
}
}
# Info
else if <context.args.get[1]> == "<s@Teams_Data.yaml_key[config.commands.args.info]>" {
- if <context.args.size> >= 2 {
# Check other team (args either player or team)
- define team <context.args.get[2]>
- define flag Teams_Group_<def[team]>_Members
- if <server.has_flag[<def[flag]>].not> {
- define Target <server.match_offline_player[<context.args.get[2]>]||null>
- if <def[Target]> == null {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.noteamfound]> <proc[Teams_Help_Message]>"
- queue clear
}
else {
# Found player
- if <def[Target].has_flag[Teams_Player_Group]||false> {
- define flag Teams_Group_<def[Target].flag[Teams_Player_Group]>_Members
- if <server.has_flag[<def[flag]>].not||true> {
- narrate "<&c><def[Target].name> <s@Teams_Data.yaml_key[config.lang.noteam]> <proc[Teams_Help_Message]>"
- queue clear
}
- define team <def[Target].flag[Teams_Player_Group]>
}
else {
- narrate "<&c><def[Target].name> <s@Teams_Data.yaml_key[config.lang.noteam]> <proc[Teams_Help_Message]>"
- queue clear
}
}
}
# Found team <def[team]>
- define flag1 "Teams_Group_<def[team]>_Kills"
- define flag2 "Teams_Group_<def[team]>_Deaths"
- define flag3 "Teams_Group_<def[team]>_Members"
- define flag4 "Teams_Group_<def[team]>_Leaders"
- define flag5 "Teams_Group_<def[team]>_Created"
- define flag6 "Teams_Group_<def[team]>_Bank"
- define flag7 "Teams_Group_<def[team]>_Rank"
- define nextlvl "<&8>(<&a><s@Teams_Data.yaml_key[config.lang.nextrank]> <&8><&co> <&c><server.flag[<def[flag1]>].round><&8>/<&c><s@Teams_Data.yaml_key[config.ranks.kills.<server.flag[Teams_Group_<def[team]>_Rank]>]> <&a><s@Teams_Data.yaml_key[config.lang.kills]><&8>)"
- define teamcolor "<s@Teams_Data.yaml_key[config.ranks.colors.<server.flag[Teams_Group_<def[team]>_Rank]>].parse_color>"
- narrate "<&9>--- --- <&b><def[team]> <&9>--- ---"
- narrate "<&a><s@Teams_Data.yaml_key[config.lang.teamtotal]> <s@Teams_Data.yaml_key[config.lang.kills]> <&8><&co> <&c><server.flag[<def[flag1]>].round>"
- narrate "<&a><s@Teams_Data.yaml_key[config.lang.teamtotal]> <s@Teams_Data.yaml_key[config.lang.deaths]> <&8><&co> <&c><server.flag[<def[flag2]>].round>"
- narrate "<&a><s@Teams_Data.yaml_key[config.lang.teamtotal]> <s@Teams_Data.yaml_key[config.lang.kdr]> <&8><&co> <&c><proc[Teams_KDR_Cal].context[<server.flag[<def[flag1]>]>|<server.flag[<def[flag2]>]>]>"
- narrate "<&a><s@Teams_Data.yaml_key[config.lang.teambank]> <&8><&co> <&c><server.flag[<def[flag6]>]> $"
- narrate "<&a><s@Teams_Data.yaml_key[config.lang.teamrank]> <&8><&co> <def[teamcolor]><s@Teams_Data.yaml_key[config.lang.level]> <server.flag[<def[flag7]>]> <def[nextlvl]>"
- narrate "<&a><s@Teams_Data.yaml_key[config.lang.leaders]> <&8><&co> <&3><server.flag[<def[flag4]>].as_list.parse[name].separated_by[<&sp>]>"
- narrate "<&a><s@Teams_Data.yaml_key[config.lang.members]> <&8><&co> <&3><server.flag[<def[flag3]>].as_list.parse[name].separated_by[<&sp>]>"
- narrate "<&9>--- --- <&7><s@Teams_Data.yaml_key[config.lang.created]> <server.flag[<def[flag5]>]> <&9>--- ---"
}
else if <player.has_flag[Teams_Player_Group]> {
# Check own team
- define flag1 "Teams_Group_<player.flag[Teams_Player_Group]>_Kills"
- define flag2 "Teams_Group_<player.flag[Teams_Player_Group]>_Deaths"
- define flag3 "Teams_Group_<player.flag[Teams_Player_Group]>_Members"
- define flag4 "Teams_Group_<player.flag[Teams_Player_Group]>_Leaders"
- define flag5 "Teams_Group_<player.flag[Teams_Player_Group]>_Created"
- define flag6 "Teams_Group_<player.flag[Teams_Player_Group]>_Bank"
- define flag7 "Teams_Group_<player.flag[Teams_Player_Group]>_Rank"
- define nextlvl "<&8>(<&a><s@Teams_Data.yaml_key[config.lang.nextrank]> <&8><&co> <&c><server.flag[<def[flag1]>].round><&8>/<&c><s@Teams_Data.yaml_key[config.ranks.kills.<server.flag[Teams_Group_<player.flag[Teams_Player_Group]>_Rank]>]> <&a><s@Teams_Data.yaml_key[config.lang.kills]><&8>)"
- define teamcolor "<s@Teams_Data.yaml_key[config.ranks.colors.<server.flag[Teams_Group_<player.flag[Teams_Player_Group]>_Rank]>].parse_color>"
- narrate "<&9>--- --- <&b><s@Teams_Data.yaml_key[config.lang.yourteam_title]> <&9>--- ---"
- narrate "<&a><s@Teams_Data.yaml_key[config.lang.teamtotal]> <s@Teams_Data.yaml_key[config.lang.kills]> <&8><&co> <&c><server.flag[<def[flag1]>].round>"
- narrate "<&a><s@Teams_Data.yaml_key[config.lang.teamtotal]> <s@Teams_Data.yaml_key[config.lang.deaths]> <&8><&co> <&c><server.flag[<def[flag2]>].round>"
- narrate "<&a><s@Teams_Data.yaml_key[config.lang.teamtotal]> <s@Teams_Data.yaml_key[config.lang.kdr]> <&8><&co> <&c><proc[Teams_KDR_Cal].context[<server.flag[<def[flag1]>]>|<server.flag[<def[flag2]>]>]>"
- narrate "<&a><s@Teams_Data.yaml_key[config.lang.teambank]> <&8><&co> <&c><server.flag[<def[flag6]>]> $"
- narrate "<&a><s@Teams_Data.yaml_key[config.lang.teamrank]> <&8><&co> <def[teamcolor]><s@Teams_Data.yaml_key[config.lang.level]> <server.flag[<def[flag7]>]> <def[nextlvl]>"
- narrate "<&a><s@Teams_Data.yaml_key[config.lang.leaders]> <&8><&co> <&3><server.flag[<def[flag4]>].as_list.parse[name].separated_by[<&sp>]>"
- narrate "<&a><s@Teams_Data.yaml_key[config.lang.members]> <&8><&co> <&3><server.flag[<def[flag3]>].as_list.parse[name].separated_by[<&sp>]>"
- narrate "<&9>--- --- <&7><s@Teams_Data.yaml_key[config.lang.created]> <server.flag[<def[flag5]>]> <&9>--- ---"
}
else {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.noteam]> <proc[Teams_Help_Message]>"
}
}
# Leave
else if <context.args.get[1]> == "<s@Teams_Data.yaml_key[config.commands.args.leave]>" {
- inject Teams_Inject_Leave
}
# top
else if <context.args.get[1]> == "<s@Teams_Data.yaml_key[config.commands.args.top]>" {
- if <server.has_flag[Teams_Groups]> {
- if <server.has_flag[teams_topkills_cooldown].not> {
- narrate "<&8><s@Teams_Data.yaml_key[config.lang.topupdate]>"
- narrate "<server.list_online_players.filter[has_flag[Teams_Player_Group]].parse[flag[Teams_Player_Group]].include[<server.flag[teams_topkills].as_list>].deduplicate.size>"
- define Leaders <server.list_online_players.filter[has_flag[Teams_Player_Group]].parse[flag[Teams_Player_Group]].include[<server.flag[teams_topkills].as_list>].deduplicate.sort[Teams_Proc_Sort].get[1].to[5]||li@>
- flag server teams_topkills_cooldown:True duration:2h
- flag server teams_topkills:!
- flag server teams_topkills:<def[Leaders]>
}
- narrate "----- <&6><s@Teams_Data.yaml_key[config.lang.toptitle]><&r> -----"
- if <server.has_flag[teams_topkills]> {
- foreach <server.flag[teams_topkills]> {
- narrate "<&9><def[loop_index]><&8>. <&6><def[Value]> <&8>- <&6><server.flag[Teams_Group_<def[Value]>_Kills].round||0> <&8>(<&9><s@Teams_Data.yaml_key[config.lang.topkdr]><&8><&co> <&6><proc[Teams_KDR_Cal].context[<server.flag[Teams_Group_<def[Value]>_Kills]>|<server.flag[Teams_Group_<def[Value]>_Deaths]>]><&8>)"
}
}
else {
- narrate "<&c>Venter på næste sortering..."
}
}
else {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.nolistteam]> <proc[Teams_Help_Message]>"
}
}
# Invite
else if <context.args.get[1]> == "<s@Teams_Data.yaml_key[config.commands.args.invite]>" {
- if <context.args.size> >= 2 {
- if <player.has_flag[Teams_Player_Group].not||true> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.noteam]> <proc[Teams_Help_Message]>"
- queue clear
}
- define flag Teams_Group_<player.flag[Teams_Player_Group]>_Leaders
- if <server.flag[<def[flag]>].as_list.contains[<player>].not> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.noleader]> <proc[Teams_Help_Message]>"
- queue clear
}
- define flag Teams_Group_<player.flag[Teams_Player_Group]>_Members
- if <server.flag[<def[flag]>].size> >= <s@Teams_Data.yaml_key[config.maxmembers]> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.teamfull]> <proc[Teams_Help_Message]>"
- queue clear
}
- define Target <server.match_player[<context.args.get[2]>]||null>
- if <def[Target]> == null {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.noplayerfound]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <def[Target]> == <player> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.notvalid]> <proc[Teams_Help_Message]>"
- queue clear
}
# else if <def[target].has_flag[Teams_Player_Group]> {
# - narrate "<&c><def[target].name> <s@Teams_Data.yaml_key[config.lang.alreadyonteam]> <proc[Teams_Help_Message]>"
# - queue clear
# }
else if <def[target].has_flag[Teams_Player_Pending]> {
- narrate "<&c><def[target].name> <s@Teams_Data.yaml_key[config.lang.alreadypending]> <proc[Teams_Help_Message]>"
- queue clear
}
- define flag Teams_Group_<player.flag[Teams_Player_Group]>_Members
- narrate "<&b><player.name> <&3><s@Teams_Data.yaml_key[config.lang.invited]> <&b><def[target].name>" targets:<server.flag[<def[flag]>].as_list.filter[is_online]>
- flag <def[target]> Teams_Player_Pending:<player.flag[Teams_Player_Group]> duration:2m
- define command "/<s@Teams_Data.yaml_key[config.commands.main]> (<s@Teams_Data.yaml_key[config.commands.args.accept]><&8>/<&a><s@Teams_Data.yaml_key[config.commands.args.deny]>)"
- define lang "<s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.invitedtoteam]>"
- narrate "<&3><def[lang]> <&b><def[target].flag[Teams_Player_Pending]> <&a><def[command]>" targets:<def[target]>
}
else {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.missargs]> <proc[Teams_Help_Message]>"
}
}
# Deny
else if <context.args.get[1]> == "<s@Teams_Data.yaml_key[config.commands.args.deny]>" {
- if <player.has_flag[Teams_Player_Pending].not||true> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.nopending]> <proc[Teams_Help_Message]>"
- queue clear
}
- narrate "<s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.declinedpending]> <player.flag[Teams_Player_Pending]>"
- define flag "Teams_Group_<player.flag[Teams_Player_Pending]>_Members"
- narrate "<&b><player.name> <&3><s@Teams_Data.yaml_key[config.lang.declinedpending]> <&b><player.flag[Teams_Player_Pending]>" targets:<server.flag[<def[flag]>].as_list.filter[is_online]>
- flag player Teams_Player_Pending:!
}
# Accept
else if <context.args.get[1]> == "<s@Teams_Data.yaml_key[config.commands.args.accept]>" {
- if <player.has_flag[Teams_Player_Pending].not||true> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.nopending]> <proc[Teams_Help_Message]>"
- queue clear
}
- define flag Teams_Group_<player.flag[Teams_Player_Pending]>_Members
- if <server.flag[<def[flag]>].size> >= <s@Teams_Data.yaml_key[config.maxmembers]> {
- narrate "<&c><player.flag[Teams_Player_Pending]> <s@Teams_Data.yaml_key[config.lang.teamfull]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <player.has_flag[Teams_Player_Group]||true> {
- inject Teams_Inject_Leave
}
- flag player Teams_Player_Group:<player.flag[Teams_Player_Pending]>
- flag server "<def[flag]>:->:<player>"
- define flag "Teams_Group_<player.flag[Teams_Player_Pending]>_Members"
- narrate "<&b><player.name> <&3><s@Teams_Data.yaml_key[config.lang.acceptedpending]> <&b><player.flag[Teams_Player_Group]>" targets:<server.flag[<def[flag]>].as_list.filter[is_online]>
- flag player Teams_Player_Pending:!
}
# Deposit
else if <context.args.get[1]> == "<s@Teams_Data.yaml_key[config.commands.args.deposit]>" {
- if <player.has_flag[Teams_Player_Group].not||true> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.noteam]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <context.args.size> >= 2 {
- define deposited <context.args.get[2].as_int||null>
- if <def[deposited]> == null {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.notvalid]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <player.money> < <def[deposited]> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.notenoughmoney]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <def[deposited]> < 0 {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.nonegative]> <proc[Teams_Help_Message]>"
- queue clear
}
- take money quantity:<def[deposited]>
- define flag Teams_Group_<player.flag[Teams_Player_Group]>_Bank
- define total <server.flag[<def[flag]>].add_int[<def[deposited]>]>
- flag server "<def[flag]>:<def[total]>"
- define flag "Teams_Group_<player.flag[Teams_Player_Group]>_Members"
- narrate "<&b><player.name> <&3><s@Teams_Data.yaml_key[config.lang.moneydeposit1]> <&b><def[deposited]> <&3><s@Teams_Data.yaml_key[config.lang.moneydeposit2]>" targets:<server.flag[<def[flag]>].as_list.filter[is_online]>
}
else {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.missargs]> <proc[Teams_Help_Message]>"
}
}
# Withdraw
else if <context.args.get[1]> == "<s@Teams_Data.yaml_key[config.commands.args.withdraw]>" {
- if <player.has_flag[Teams_Player_Group].not||true> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.noteam]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <context.args.size> >= 2 {
- define flag Teams_Group_<player.flag[Teams_Player_Group]>_Leaders
- if <server.flag[<def[flag]>].as_list.contains[<player>].not||true> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.noleader]> <proc[Teams_Help_Message]>"
- queue clear
}
- define flag Teams_Group_<player.flag[Teams_Player_Group]>_Bank
- define withdrew <context.args.get[2].as_int||null>
- if <def[withdrew]> == null {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.notvalid]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <server.flag[<def[flag]>]> < <def[withdrew]> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.notenoughmoney]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <def[withdrew]> < 0 {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.nonegative]> <proc[Teams_Help_Message]>"
- queue clear
}
- define total <server.flag[<def[flag]>].sub_int[<def[withdrew]>]>
- give money quantity:<def[withdrew]>
- flag server "<def[flag]>:<def[total]>"
- define flag "Teams_Group_<player.flag[Teams_Player_Group]>_Members"
- narrate "<&b><player.name> <&3><s@Teams_Data.yaml_key[config.lang.moneywithdraw1]> <&b><def[withdrew]> <&3><s@Teams_Data.yaml_key[config.lang.moneywithdraw2]>" targets:<server.flag[<def[flag]>].as_list.filter[is_online]>
}
else {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.missargs]> <proc[Teams_Help_Message]>"
}
}
# Rename
else if <context.args.get[1]> == "<s@Teams_Data.yaml_key[config.commands.args.rename]>" {
- if <player.has_flag[Teams_Player_Spam]> {
- narrate "<s@Teams_Data.yaml_key[config.lang.spamming]> <player.flag[Teams_Player_Spam].expiration.formatted>"
- queue clear
}
- if <context.args.size> >= 2 {
- define newteam "<context.args.get[2]>"
- if <player.has_flag[Teams_Player_Group].not> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.noteam]> <proc[Teams_Help_Message]>"
- queue clear
}
- define flag Teams_Group_<player.flag[Teams_Player_Group]>_Leaders
- if <server.flag[<def[flag]>].as_list.contains[<player>].not> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.noleader]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <server.has_flag[Teams_Group_<def[newteam]>_Created]> {
- narrate "<&c><def[newteam]> <s@Teams_Data.yaml_key[config.lang.teamalreadyexist]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <def[newteam].length> > <s@Teams_Data.yaml_key[config.namemaxlength]> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.nametoolong]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <def[newteam].length> < <s@Teams_Data.yaml_key[config.nameminlength]> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.nametooshort]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <def[newteam].contains_any[*|?|,|.|!|(|)|/|#|¤|%|&|/|<&nl>|<&>|<&cm>|<&ss>|<&sq>|<&sp>|< >|<&dq>|<&co>|<&sc>|<&rb>|<&lb>|<&rc>|<&lc>|<&ns>|<&pc>|<&pipe>|<&ds>|<<>|<>>|<&bs>|<&at>|<&dot>]||true> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.notvalid]> <proc[Teams_Help_Message]>"
- queue clear
}
- flag player Teams_Player_Spam:True duration:30s
- define oldteam <player.flag[Teams_Player_Group]>
- define flag1new "Teams_Group_<def[newteam]>_Kills"
- define flag1old "Teams_Group_<def[oldteam]>_Kills"
- flag server "<def[flag1new]>:<server.flag[<def[flag1old]>]>"
- define flag2new "Teams_Group_<def[newteam]>_Deaths"
- define flag2old "Teams_Group_<def[oldteam]>_Deaths"
- flag server "<def[flag2new]>:<server.flag[<def[flag2old]>]>"
- define flag3new "Teams_Group_<def[newteam]>_Bank"
- define flag3old "Teams_Group_<def[oldteam]>_Bank"
- flag server "<def[flag3new]>:<server.flag[<def[flag3old]>]>"
- define flag4new "Teams_Group_<def[newteam]>_Rank"
- define flag4old "Teams_Group_<def[oldteam]>_Rank"
- flag server "<def[flag4new]>:<server.flag[<def[flag4old]>]>"
- define flag5new "Teams_Group_<def[newteam]>_Members"
- define flag5old "Teams_Group_<def[oldteam]>_Members"
- foreach <server.flag[<def[flag5old]>].as_list> {
- flag server "<def[flag5new]>:->:<def[value]>"
- flag <def[value]> Teams_Player_Group:<def[newteam]>
}
- define flag6new "Teams_Group_<def[newteam]>_Leaders"
- define flag6old "Teams_Group_<def[oldteam]>_Leaders"
- foreach <server.flag[<def[flag6old]>].as_list> {
- flag server "<def[flag6new]>:->:<def[value]>"
}
- define flag7new "Teams_Group_<def[newteam]>_Created"
- define flag7old "Teams_Group_<def[oldteam]>_Created"
- flag server "<def[flag7new]>:<server.flag[<def[flag7old]>]>"
- flag server Teams_Groups:->:<def[newteam]>
- flag server Teams_Groups:<-:<def[oldteam]>
- define flag Teams_Group_<def[oldteam]>_Kills
- flag server "<def[flag]>:!"
- define flag Teams_Group_<def[oldteam]>_Deaths
- flag server "<def[flag]>:!"
- define flag Teams_Group_<def[oldteam]>_Members
- flag server "<def[flag]>:!"
- define flag Teams_Group_<def[oldteam]>_Leaders
- flag server "<def[flag]>:!"
- define flag Teams_Group_<def[oldteam]>_Rank
- flag server "<def[flag]>:!"
- define flag Teams_Group_<def[oldteam]>_Bank
- flag server "<def[flag]>:!"
- define flag Teams_Group_<def[oldteam]>_Created
- flag server "<def[flag]>:!"
- announce "<&b><player.name> <&3><s@Teams_Data.yaml_key[config.lang.renamedteam1]> <&b><def[oldteam]> <&3><s@Teams_Data.yaml_key[config.lang.renamedteam2]> <&b><def[newteam]>"
}
else {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.missargs]> <proc[Teams_Help_Message]>"
}
}
# Promote
else if <context.args.get[1]> == "<s@Teams_Data.yaml_key[config.commands.args.promote]||false>" {
- if <player.has_flag[Teams_Player_Group].not||false> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.noteam]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <context.args.size> >= 2 {
- define flag1 Teams_Group_<player.flag[Teams_Player_Group]>_Leaders
- if <server.flag[<def[flag1]>].as_list.contains[<player>].not||true> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.noleader]> <proc[Teams_Help_Message]>"
- queue clear
}
- define target <server.match_player[<context.args.get[2]>]||null>
- if <def[target]> == null {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.noplayerfound]> <proc[Teams_Help_Message]>"
- queue clear
}
- define flag2 Teams_Group_<player.flag[Teams_Player_Group]>_Members
- if <server.flag[<def[flag2]>].as_list.contains[<def[target]>].not> {
- narrate "<&c><def[target].name> <s@Teams_Data.yaml_key[config.lang.notyourside]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <server.flag[<def[flag1]>].as_list.contains[<def[target]>]||true> {
- narrate "<&c><def[target].name> <s@Teams_Data.yaml_key[config.lang.alreadyleader]> <proc[Teams_Help_Message]>"
- queue clear
}
# Give promotion
- flag server "<def[flag1]>:->:<def[target]>"
- define flag "Teams_Group_<player.flag[Teams_Player_Group]>_Members"
- narrate "<&b><player.name> <&3><s@Teams_Data.yaml_key[config.lang.promoted]> <&b><def[target].name>" targets:<server.flag[<def[flag]>].as_list.filter[is_online]>
}
else {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.missargs]> <proc[Teams_Help_Message]>"
}
}
# kick
else if <context.args.get[1]> == "<s@Teams_Data.yaml_key[config.commands.args.kick]||false>" {
- if <player.has_flag[Teams_Player_Group].not||true> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.noteam]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <context.args.size||false> >= 2 {
- define flag1 Teams_Group_<player.flag[Teams_Player_Group]>_Leaders
- if <server.flag[<def[flag1]>].as_list.contains[<player>].not> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.noleader]> <proc[Teams_Help_Message]>"
- queue clear
}
- define target <server.match_offline_player[<context.args.get[2]>]||null>
- if <def[target]> == null {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.noplayerfound]> <proc[Teams_Help_Message]>"
- queue clear
}
- define flag2 Teams_Group_<player.flag[Teams_Player_Group]>_Members
- if <server.flag[<def[flag2]>].as_list.contains[<def[target]>].not||true> {
## HOTFIX
- if <server.flag[<def[flag1]>].as_list.contains[<def[target]>]||true> {
- announce "<&c><def[target].name> er leder på <player.flag[Teams_Player_Group]> men ikke member!" to_flagged:Show_Errors
- flag server "<def[flag1]>:<-:<def[target]>"
}
##
- narrate "<&c><def[target].name> <s@Teams_Data.yaml_key[config.lang.notyourside]> <proc[Teams_Help_Message]>"
- queue clear
}
- if <server.flag[<def[flag1]>].as_list.contains[<def[target]>]||true> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.cannotkickleader]> <proc[Teams_Help_Message]>"
- queue clear
}
- flag server "<def[flag2]>:<-:<def[target]>"
- flag <def[target]> Teams_Player_Group:!
- run Teams_Kicked_player player:<def[target]>
- if <def[target].is_online||false> {
- narrate "<&3><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.gotkicked]> <&b><player.flag[Teams_Player_Group]>" targets:<def[target]>
}
- define flag "Teams_Group_<player.flag[Teams_Player_Group]>_Members"
- narrate "<&b><player.name> <&3><s@Teams_Data.yaml_key[config.lang.waskicked1]> <&b><def[target].name> <&3><s@Teams_Data.yaml_key[config.lang.waskicked2]> <&b><player.flag[Teams_Player_Group]>" targets:<server.flag[<def[flag]>].as_list.filter[is_online]>
}
else {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.missargs]> <proc[Teams_Help_Message]>"
}
}
else {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.unknown]> <proc[Teams_Help_Message]>"
}
}
else {
- if <player.has_flag[Teams_Player_Group]||false> {
- flag server Teams_Target_Menu:<player>
- inventory open d:in@Teams_Menu_v2
# - inventory open d:in@Teams_Menu
}
else {
- inject Teams_Help_List
}
}
Teams_Kicked_player:
type: task
debug: false
script:
- flag player Teams_Player_Group:!
Teams_Inject_Leave:
type: task
debug: false
script:
- if <player.has_flag[Teams_Player_Spam]> {
- narrate "<s@Teams_Data.yaml_key[config.lang.spamming]> <player.flag[Teams_Player_Spam].expiration.formatted>"
- queue clear
}
- if <player.has_flag[Teams_Player_Group]> {
- narrate "<&3><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.leftteam]> <&b><player.flag[Teams_Player_Group]>"
- define team <player.flag[Teams_Player_Group]>
- flag player Teams_Player_Group:!
- define flag Teams_Group_<def[team]>_Members
- flag server "<def[flag]>:<-:<player>"
- if <server.has_flag[<def[flag]>]> {
- if <server.flag[<def[flag]>].as_list.is_empty.not||false> {
- narrate "<&b><player.name> <&3><s@Teams_Data.yaml_key[config.lang.leftteam]> <&b><def[team]>" targets:<server.flag[<def[flag]>].as_list.filter[is_online]>
}
}
- define flag Teams_Group_<def[team]>_Leaders
- if <server.flag[<def[flag]>].as_list.contains[<player>]> {
- flag player Teams_Player_Spam:True duration:30s
- flag server "<def[flag]>:<-:<player>"
- if <server.has_flag[<def[flag]>].not> {
- if <server.flag[<def[flag]>].as_list.is_empty||true> {
# Remove team
- define flag Teams_Group_<def[team]>_Kills
- flag server "<def[flag]>:!"
- define flag Teams_Group_<def[team]>_Deaths
- flag server "<def[flag]>:!"
- define flag Teams_Group_<def[team]>_Members
- if <server.has_flag[<def[flag]>]> {
- foreach <server.flag[<def[flag]>].as_list> {
- flag <def[value]> Teams_Player_Group:!
}
}
- flag server "<def[flag]>:!"
- define flag Teams_Group_<def[team]>_Leaders
- flag server "<def[flag]>:!"
- define flag Teams_Group_<def[team]>_Rank
- flag server "<def[flag]>:!"
- define flag Teams_Group_<def[team]>_Bank
- flag server "<def[flag]>:!"
- define flag Teams_Group_<def[team]>_Created
- flag server "<def[flag]>:!"
- flag server "Teams_Groups:<-:<def[team]>"
- announce "<&3><s@Teams_Data.yaml_key[config.lang.teamdisband1]> <&b><def[team]> <&3><s@Teams_Data.yaml_key[config.lang.teamdisband2]> <&b><player.name>"
}
}
}
}
else {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.noteam]> <proc[Teams_Help_Message]>"
}
Teams_Chat:
type: command
name: teamchat
debug: false
description: Commands for teams.
usage: /teamchat
aliases:
- tc
# permission: ggpvp.teams
# permission message: Sorry, <player.name>, you don't have the permission '<permission>'!
script:
- if <player.has_flag[Teams_Player_Group].not> {
- narrate "<&c><s@Teams_Data.yaml_key[config.lang.you]> <s@Teams_Data.yaml_key[config.lang.noteam]> <proc[Teams_Help_Message]>"
- queue clear
}
- define flag "Teams_Group_<player.flag[Teams_Player_Group]>_Members"
- narrate "<&8>[<&c>Team-Chat<&8>] <&b><player.name><&co> <&e><context.raw_args>" targets:<server.flag[<def[flag]>].as_list.filter[is_online]>
# Menu
Teams_Menu_Proc:
type: procedure
debug: false
definitions: item|line
script:
- define value "<s@Teams_Data.list_keys[config.commands.args].get[<def[item]>]>"
- choose "<def[line]>":
- case "1":
- determine red_wool
- case "2":
- determine "<&6><&l><s@Teams_Data.yaml_key[config.commands.args.<def[value]>].to_titlecase>"
- case "3":
- determine "<&b><s@Teams_Data.yaml_key[config.commands.args_descriptions.<def[value]>]>"
- default:
- determine "Chosen default"
Teams_Menu_Proc_v2:
type: procedure
debug: false
definitions: item|line
script:
- define target <server.flag[Teams_Target_Menu]>
- choose "<def[item]>":
- case "name":
- choose "<def[line]>":
- case "1":
- determine book
- case "2":
- determine "<&6><&l><def[target].flag[Teams_Player_Group]>"
- case "3":
- determine "<&a><s@Teams_Data.yaml_key[config.lang.moreinfo]> "
- case "4":
- determine "<proc[Teams_Help_Message]>"
- case "5":
- determine "<&7>"
- case "6":
- determine "<&7><s@Teams_Data.yaml_key[config.lang.created]>"
- case "7":
- determine "<&7><server.flag[Teams_Group_<def[target].flag[Teams_Player_Group]>_Created]>"
- default:
- determine "Chosen default in <def[item]>"
- case "kills":
- choose "<def[line]>":
- case "1":
- determine diamond_sword
- case "2":
- determine "<&a><s@Teams_Data.yaml_key[config.lang.teamtotal]> <&8><&co>"
- case "3":
- determine "<&c><&l><server.flag[Teams_Group_<def[target].flag[Teams_Player_Group]>_Kills].round||0> <&6><s@Teams_Data.yaml_key[config.lang.kills]>"
- case "4":
- determine "<&c><&l><server.flag[Teams_Group_<def[target].flag[Teams_Player_Group]>_Deaths].round||0> <&6><s@Teams_Data.yaml_key[config.lang.deaths]>"
- case "5":
- define flag1 Teams_Group_<def[target].flag[Teams_Player_Group]>_Kills
- define flag2 Teams_Group_<def[target].flag[Teams_Player_Group]>_Deaths
# <server.flag[<def[flag1]>].div[<server.flag[<def[flag2]>]>].round_to[2]||0>
- determine "<&c><&l><proc[Teams_KDR_Cal].context[<server.flag[<def[flag1]>]>|<server.flag[<def[flag2]>]>]> <&6><s@Teams_Data.yaml_key[config.lang.kdr]>"
- default:
- determine "Chosen default in <def[item]>"
- case "members":
- choose "<def[line]>":
- case "1":
- determine diamond_chestplate
- case "2":
- determine "<&a><s@Teams_Data.yaml_key[config.lang.leaders]> <&8><&co> "
- case "3":
- determine "<&3><server.flag[Teams_Group_<def[target].flag[Teams_Player_Group]>_Leaders].as_list.parse[name].separated_by[|<&3>]>"
- case "4":
- determine "<&a><s@Teams_Data.yaml_key[config.lang.members]> <&8><&co> "
- case "5":
## change to foreach loop (with define)
- determine "<&3><server.flag[Teams_Group_<def[target].flag[Teams_Player_Group]>_Members].as_list.parse[name].separated_by[|<&3>]>"
- case "6":
- determine "<&8>(<&c><server.flag[Teams_Group_<def[target].flag[Teams_Player_Group]>_Members].as_list.size><&8>/<&c><s@Teams_Data.yaml_key[config.maxmembers]><&8>)"
- default:
- determine "Chosen default in <def[item]>"
- case "rank":
- choose "<def[line]>":
- case "1":
- determine redstone
- case "2":
- determine "<&a><s@Teams_Data.yaml_key[config.lang.teamrank]> <&8><&co> "
- case "3":
- define teamcolor "<s@Teams_Data.yaml_key[config.ranks.colors.<server.flag[Teams_Group_<def[target].flag[Teams_Player_Group]>_Rank]>].parse_color>"
- determine "<def[teamcolor]><&l><s@Teams_Data.yaml_key[config.lang.level]> <server.flag[Teams_Group_<def[target].flag[Teams_Player_Group]>_Rank].round||0>"
- case "4":
- define nextlvl "<&c><server.flag[Teams_Group_<def[target].flag[Teams_Player_Group]>_Kills].round><&8>/<&c><s@Teams_Data.yaml_key[config.ranks.kills.<server.flag[Teams_Group_<def[target].flag[Teams_Player_Group]>_Rank]>]> <&a><s@Teams_Data.yaml_key[config.lang.kills]>"
- determine "<&a><s@Teams_Data.yaml_key[config.lang.nextrank]> <&8><&co> <def[nextlvl]>"
- default:
- determine "Chosen default in <def[item]>"
- case "money":
- choose "<def[line]>":
- case "1":
- determine Nether_Star
- case "2":
- determine "<&a><s@Teams_Data.yaml_key[config.lang.teambank]> <&8><&co> "
- case "3":
- determine "<&c><&l><server.flag[Teams_Group_<def[target].flag[Teams_Player_Group]>_Bank]||0>"
- default:
- determine "Chosen default"
Teams_Menu_v2:
type: inventory
debug: false
inventory: CHEST
title: <&8><s@Teams_Data.yaml_key[config.lang.yourteam_title]>
size: 54
definitions:
name: <proc[Teams_Menu_Proc_v2].context[name|1]>[display_name=<proc[Teams_Menu_Proc_v2].context[name|2]>;lore=li@<proc[Teams_Menu_Proc_v2].context[name|3]>|<proc[Teams_Menu_Proc_v2].context[name|4]>|<proc[Teams_Menu_Proc_v2].context[name|5]>|<proc[Teams_Menu_Proc_v2].context[name|6]>|<proc[Teams_Menu_Proc_v2].context[name|7]>]
kills: <proc[Teams_Menu_Proc_v2].context[kills|1]>[flags=HIDE_ATTRIBUTES;display_name=<proc[Teams_Menu_Proc_v2].context[kills|2]>;lore=li@<proc[Teams_Menu_Proc_v2].context[kills|3]>|<proc[Teams_Menu_Proc_v2].context[kills|4]>|<proc[Teams_Menu_Proc_v2].context[kills|5]>]
members: <proc[Teams_Menu_Proc_v2].context[members|1]>[display_name=<proc[Teams_Menu_Proc_v2].context[members|2]>;lore=li@<proc[Teams_Menu_Proc_v2].context[members|3]>|<proc[Teams_Menu_Proc_v2].context[members|4]>|<proc[Teams_Menu_Proc_v2].context[members|5]>|<proc[Teams_Menu_Proc_v2].context[members|6]>]
close: i@Teams_Close
penge: <proc[Teams_Menu_Proc_v2].context[money|1]>[display_name=<proc[Teams_Menu_Proc_v2].context[money|2]>;lore=li@<proc[Teams_Menu_Proc_v2].context[money|3]>]
rank: <proc[Teams_Menu_Proc_v2].context[rank|1]>[flags=HIDE_ATTRIBUTES;display_name=<proc[Teams_Menu_Proc_v2].context[rank|2]>;lore=li@<proc[Teams_Menu_Proc_v2].context[rank|3]>|<proc[Teams_Menu_Proc_v2].context[rank|4]>]
slots:
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [] [rank] [] [] [] []"
- "[] [] [kills] [] [] [] [members] [] []"
- "[] [] [] [] [penge] [] [] [] []"
- "[] [] [] [] [] [] [] [] []"
- "[] [] [] [] [name] [] [] [] [Close]"
Teams_Menu:
type: inventory
debug: false
inventory: CHEST
title: <&8><s@Teams_Data.yaml_key[config.lang.help_title]>
size: 18
definitions:
T1: <proc[Teams_Menu_Proc].context[1|1]>[display_name=<proc[Teams_Menu_Proc].context[1|2]>;lore=li@<proc[Teams_Menu_Proc].context[1|3]>]
T2: <proc[Teams_Menu_Proc].context[2|1]>[display_name=<proc[Teams_Menu_Proc].context[2|2]>;lore=li@<proc[Teams_Menu_Proc].context[2|3]>]
T3: <proc[Teams_Menu_Proc].context[3|1]>[display_name=<proc[Teams_Menu_Proc].context[3|2]>;lore=li@<proc[Teams_Menu_Proc].context[3|3]>]
T4: <proc[Teams_Menu_Proc].context[4|1]>[display_name=<proc[Teams_Menu_Proc].context[4|2]>;lore=li@<proc[Teams_Menu_Proc].context[4|3]>]
T5: <proc[Teams_Menu_Proc].context[5|1]>[display_name=<proc[Teams_Menu_Proc].context[5|2]>;lore=li@<proc[Teams_Menu_Proc].context[5|3]>]
T6: <proc[Teams_Menu_Proc].context[6|1]>[display_name=<proc[Teams_Menu_Proc].context[6|2]>;lore=li@<proc[Teams_Menu_Proc].context[6|3]>]
T7: <proc[Teams_Menu_Proc].context[7|1]>[display_name=<proc[Teams_Menu_Proc].context[7|2]>;lore=li@<proc[Teams_Menu_Proc].context[7|3]>]
T8: <proc[Teams_Menu_Proc].context[8|1]>[display_name=<proc[Teams_Menu_Proc].context[8|2]>;lore=li@<proc[Teams_Menu_Proc].context[8|3]>]
T9: <proc[Teams_Menu_Proc].context[9|1]>[display_name=<proc[Teams_Menu_Proc].context[9|2]>;lore=li@<proc[Teams_Menu_Proc].context[9|3]>]
T10: <proc[Teams_Menu_Proc].context[10|1]>[display_name=<proc[Teams_Menu_Proc].context[10|2]>;lore=li@<proc[Teams_Menu_Proc].context[10|3]>]
Close: i@Teams_Close
slots:
- "[T1] [T2] [T3] [T4] [T5] [] [] [] []"
- "[T6] [T7] [T8] [T9] [T10] [] [] [] [Close]"
Teams_Close:
type: item
debug: false
material: BARRIER
display name: <&a>Luk Menu
## TODO: MAY OR MAY NOT SORT CORRECTLY!
Teams_Proc_Sort:
type: procedure
debug: false
definitions: p1|p2
script:
# If P2's kill score is better than P1's move P2 up, ooh that bitch is climbin!
- if <server.flag[Teams_Group_<def[p2]>_Kills].round||0> > <server.flag[Teams_Group_<def[p1]>_Kills].round||0> {
- determine 1
}
# If P1's kill score is better than P2's move P1 up, ooh that bitch is climbin!
else if <server.flag[Teams_Group_<def[p1]>_Kills].round||0> > <server.flag[Teams_Group_<def[p2]>_Kills].round||0> {
- determine -1
}
# Their kill score is equal, so do nothing... boring..
else {
- determine 0
}
## <proc[].context[kills|death]>
Teams_KDR_Cal:
type: procedure
debug: false
definitions: kills|death
script:
- if <def[death].round> == 0 {
- determine "0"
}
else if <def[death].round> == <def[kills]> {
- determine "1"
}
else {
- determine "<def[kills].div[<def[death]>].round_to[2]>"
}
Teams_Members_proc:
type: procedure
debug: false
definitions: team
script:
- if <def[team].round> == 0 {
- determine "0"
}
else if <def[death].round> == <def[kills]> {
- determine "1"
}
else {
- determine "<def[kills].div[<def[death]>].round_to[2]>"
}
# <&3><server.flag[Teams_Group_<def[target].
# flag[Teams_Player_Group]>_Leaders].as_list.parse[name].
# separated_by[|<&3>]>
View History