Gangs

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 6

Options:

Prefix: &8[&2Void&aGangs&8]
GangChatFormat: &d[%{gang::prefix::%{gang::%player's uuid%}%}%&d] &b%player's
display name% &e[GANGCHAT] &8&l» &6%message%

command /gang [<text>] [<text>]:


aliases: /g
trigger:
if arg-1 is "info":
if arg-2 is set:
send " "
send "{@Prefix}&e: &cHere is the info for the specified
gang!"
send " "
send "%{gang::info::%arg-2%}%"
send " "
send "&dAdditional information:"
send "&a&l- &eMember count: %size of {gang::%arg-
2%::members::*}%"
send "&a&l- &ePrefix: %{gang::prefix::%arg-2%}%"
send "&a&l- &eOwner: %{gang::owner::%arg-2%} parsed as a
player%"
send " "
if arg-1 is "sethome":
if {gang::admins::%{gang::%player's uuid%}%::*} contains player's
uuid:
set {gang::home::%{gang::%player's uuid%}%} to player's
location
send " "
send "{@Prefix}&e: &cSet the gang home to your location!"
send " "
else:
send " "
send "{@Prefix}&e: &cYou're not an admin in your gang!"
send " "
if arg-1 is "list":
send " "
send "{@Prefix}&e: &cHere is the list of gangs!"
send " "
loop {gangs::*}:
send formatted "&a&l- &e%loop-value% <command:/gang info
%loop-value%><tooltip:&6Click for more information!>&8[&7CLICK HERE FOR INFO&8]" to
player
send " "
if arg-1 is "infoset":
if arg-2 is "set":
set metadata "info" of player to true
send " "
send "{@Prefix}&e: &cType the info for your gang in the
chat! Limit of 200 characters! &e(type 'stop' to cancel)"
send " "
if arg-1 is "help":
send " "
send "{@Prefix}&e: &cHere is the list of commands!"
send " "
send "&a&l- &b/&cgang list &dThis is for viewing all gangs."
send "&a&l- &b/&cgang info &e(name) &dThis is for seeing
information on gangs."
send "&a&l- &b/&cgang join &e(name) &dThis is for joining a
public gang."
send "&a&l- &b/&cgang apply &e(name) &dThis is for applying for
a private gang."
send "&a&l- &b/&cgang create &e(name) &dThis is for creating a
gang."
send "&a&l- &b/&cgang disband &dThis is for disbanding your
gang."
send "&a&l- &b/&cgang admin &dThis is for displaying list of
admin commands for your gang."
send "&a&l- &b/&cgang chat &dThis is for toggling the seperate
gang chat."
send " "
if arg-1 is "promote":
if arg-2 is set:
if {gang::owner::%{gang::%player's uuid%}%} is player's
uuid:
if {gang::%{gang::%player's uuid%}%::members::*}
contains (arg-2 parsed as a player)'s uuid:
if {gang::admins::%{gang::%player's uuid%}%::*}
does not contain (arg-2 parsed as a player)'s uuid:
add (arg-2 parsed as a player) to
{gang::admins::%{gang::%player's uuid%}%::*}
send " "
send "{@Prefix}&e: &cAdded %(arg-2 parsed
as a player)% &cto the gang!"
send " "
else:
send " "
send "{@Prefix}&e: &cThat player is
already admin!"
send " "
else:
send " "
send "{@Prefix}&e: &cThat player is not in your
gang!"
send " "
else:
send " "
send "{@Prefix}&e: &cYou need to be owner of your
gang to do this!"
send " "
if arg-1 is "create":
if arg-2 is set:
if {gang::%player's uuid%} is set:
send " "
send "{@Prefix}&e: &cLeave your gang before creating
a new one!"
send " "
stop
set {gang::admins::%arg-2%::*} to player's uuid
set {gang::info::%arg-2%} to "&8Just another great gang!"
set {gang::%arg-2%::members::*} to player's uuid
add uncolored arg-2 to {gangs::*}
set {gang::owner::%arg-2%} to player's uuid
set {gang::status::%arg-2%} to "private"
set {gang::%player's uuid%} to arg-2
send " "
send "{@Prefix}&e: &cSuccessfully created gang &a%colored
arg-2%&c!"
send " "
set {gang::prefix::%arg-2%} to colored arg-2
if arg-1 is "disband":
if {gang::owner::%{gang::%player's uuid%}%} is player's uuid:
remove uncolored {gang::%player's uuid%} from {gangs::*}
send " "
send "{@Prefix}&e: &cSuccessfully removed gang &a%colored
{gang::%player's uuid%}%&c!"
send " "
clear {gang::info::%{gang::%player's uuid%}%}
clear {gang::prefix::%{gang::%player's uuid%}%}
clear {gang::owner::%{gang::%player's uuid%}%}
clear {gang::prefix::%{gang::%player's uuid%}%}
clear {gang::%{gang::%player's uuid%}%::members::*}
clear {gang::%player's uuid%}
else if player has permission "gang.delete":
remove uncolored arg-2 from {gangs::*}
send " "
send "{@Prefix}&e: &cSuccessfully force removed gang &a
%colored arg-2%&c!"
send " "
if arg-1 is "join":
if {gang::%arg-2%::members::*} contains player's uuid:
send " "
send "{@Prefix}&e: &cYou are already in this gang!"
send " "
stop
else if {gang::status::%arg-2%} is "private":
send " "
send "{@Prefix}&e: &cThis gang is not public! &aTo join it,
you need to apply &a(&9/gang apply [name]&a)!"
send " "
else if {gang::status::%arg-2%} is "public":
add player's uuid to {gang::%arg-2%::members::*}
set {gang::%player's uuid%} to uncolored arg-2
send " "
send "{@Prefix}&e: &cSuccessfully joined gang &a%arg-2%&c!"
send " "
else if {gang::status::%arg-2%} is "closed":
send " "
send "{@Prefix}&e: &cThis gang is closed, sorry!"
send " "
else:
send " "
send "{@Prefix}&e: &cThis gang doesn't exist! :("
send " "
if arg-1 is "admin":
loop {gangs::*}:
if {gang::admins::%{gang::%player's uuid%}%::*} contains
player's uuid:
gangadmin("%loop-value%", player)
stop
send " "
send "{@Prefix}&e: &cYou aren't admin on any gang!"
send " "
if arg-1 is "leave":
if {gang::%player's uuid%} is set:
if {gang::owner::%{gang::%player's uuid%}%} is not player's
uuid:
remove player's uuid from {gang::%{gang::%player's
uuid%}%::members::*}
send " "
send "{@Prefix}&e: &cSuccessfully left your gang, &a%
{gang::%player's uuid%}%&c."
send " "
clear {gang::%player's uuid%}
else:
send " "
send "{@Prefix}&e: &cYou can't leave a gang you own!
&aPromote someone or disband it."
send " "
if arg-1 is "chat" or "c":
if {gangchat::%player%} is true:
send " "
send "{@Prefix}&e: &cYou are no longer in your gang's
chat!"
send " "
set {gangchat::%player%} to false
else:
set {gangchat::%player%} to true
send " "
send "{@Prefix}&e: &cYou are now in your gang's chat!"
send " "
if arg-1 is "status":
set {gang::status::%{gang::%player's uuid%}%} to arg-2
send " "
send "{@Prefix}&e: &cSet the status for your gang to &e%arg-
2%&c!"
send " "
if arg-1 is "prefix":
if arg-2 is "set":
send " "
send "{@Prefix}&e: &cType the new prefix in the chat!
&eLimitations: &9Maximum of &613 &9letters&e, &9no magic text&e, &9and no
impersonating other gangs! &e(type 'stop' to cancel)"
send " "
set metadata "prefix" of player to true

function gangadmin(t: text, p: player):


send "&a&l------------------------------------" to {_p}
send " " to {_p}
send "&e&lSettings for gang: &c&l%{_t}%" to {_p}
send " " to {_p}
if {gang::status::%{_t}%} = "private":
send formatted "&a&l- &dStatus: <command:/gang status
public><tooltip:&6Click to scroll different statuses!>&6<<reset>&a%{gang::status::%
{_t}%}%<command:/gang status closed><tooltip:&6Click to scroll different statuses!
>&6><reset> &8[&7CLICK ON ARROWS TO SWITCH&8]" to {_p}
else if {gang::status::%{_t}%} = "public":
send formatted "&a&l- &dStatus: <command:/gang status
closed><tooltip:&6Click to scroll different statuses!>&6<<reset>&a%{gang::status::%
{_t}%}%<command:/gang status private><tooltip:&6Click to scroll different statuses!
>&6><reset> &8[&7CLICK ON ARROWS TO SWITCH&8]" to {_p}
else if {gang::status::%{_t}%} = "closed":
send formatted "&a&l- &dStatus: <command:/gang status
private><tooltip:&6Click to scroll different statuses!>&6<<reset>&a%{gang::status::
%{_t}%}%<command:/gang status public><tooltip:&6Click to scroll different statuses!
>&6><reset> &8[&7CLICK ON ARROWS TO SWITCH&8]" to {_p}
send formatted "&a&l- &dPrefix: <command:/gang prefix set><tooltip:&6Click to
change your gang prefix!>&f%colored {gang::prefix::%{_t}%}% &8[&7CLICK TO
SWITCH&8]" to {_p}
set {_t} to {_p}'s uuid
send formatted "&a&l- &dGang Info: <command:/gang infoset
set><tooltip:&6Click to change the info for your gang!>&f%{gang::info::%{gang::%
{_t}%}%}% &8[&7CLICK TO SWITCH&8]" to {_p}
send " " to {_p}
send "&a&l------------------------------------" to {_p}

on chat:
if metadata "prefix" of player is true:
cancel event
if message is "stop":
send "&cCancelled!"
set metadata "prefix" of player to false
set {_text} to colored message
replace all "&k" in {_text} with ""
set {_num} to the length of (uncolored {_text})
if {_num} > 13:
send " "
send "{@Prefix}&e: &cCould not set the prefix- it was too long."
send " "
set metadata "prefix" of player to false
stop
loop {gangs::*}:
if (colored {gang::prefix::%loop-value%}) = (colored {_text}):
send " "
send "{@Prefix}&e: &cCould not set the prefix- it has
already been taken! &4&lImpersonating another gang will lead to punishment."
send " "
set metadata "prefix" of player to false
stop

set {gang::prefix::%{gang::%player's uuid%}%} to colored {_text}


send " "
send "{@Prefix}&e: &cSet the prefix for your gang to &e%colored {_text}
%&c!"
send " "
set metadata "prefix" of player to false
stop
if metadata "info" of player is true:
cancel event
if message is "stop":
send "&cCancelled!"
set metadata "info" of player to false
set {_text} to colored message
set {_num} to the length of (uncolored {_text})
if {_num} > 200:
send " "
send "{@Prefix}&e: &cCould not set the prefix- it was too long."
send " "
set metadata "info" of player to false
stop
set {gang::info::%{gang::%player's uuid%}%} to colored message
send " "
send "{@Prefix}&e: &cSet the info for your gang to &e%colored message
%&c!"
send " "
set metadata "info" of player to false
stop
if {Globalchat} is true:
if player has the permission "op":
set chat format to "%colored player's prefix%%player's
displayname% %colored player's suffix%&8| &f%colored message%"
stop
else:
cancel event
send "&3The chat is currently muted!"
stop
if {gang::prefix::%{gang::%player's uuid%}%} is set:
set player's prefix to "&8[%colored {gang::prefix::%{gang::%player's
uuid%}%}%&8]"
else:
set player's prefix to "&7Default"
if player has permission "color.chat":
set the chat format to "%colored player's prefix% &7%player's
displayname% %colored player's suffix%&8| &f%colored message%"
else:
set the chat format to "%colored player's prefix% &7%player's
displayname% %colored player's suffix%&8| &f%message%"
if {gangchat::%player%} is true:
set chat format to "{@GangChatFormat}"
loop all players:
if {gang::%loop-player's uuid%} != {gang::%player's uuid%}:
remove loop-player from chat recipients

You might also like