Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fHelp(p: player):
- send "&9----------------------------------------------------" to {_p}
- send "&aFriend Commands:" to {_p}
- send "&e/friend help &b- Prints this help message" to {_p}
- send "&e/friend add &b- Add a player as a friend" to {_p}
- send "&e/friend accept &b- Accept a friend request" to {_p}
- send "&e/friend deny &b- Decline a friend request" to {_p}
- send "&e/friend list &b- List your friends" to {_p}
- send "&e/friend remove <player> &b- Remove a player from your friends" to {_p}
- #send "&e/friend removeall &b- Remove all your friends" to {_p}
- send "&9----------------------------------------------------" to {_p}
- function fReq(p: player, r: offline player):
- set {_id} to {_p}'s uuid
- set {_rd} to {_r}'s uuid
- if {ignore.%{_id}%::%{_rd}%} is {_rd}:
- send "&9----------------------------------------------------" to {_p}
- send "&cYou aren't allowed to send friend requests to this person!" to {_p}
- send "&9----------------------------------------------------" to {_p}
- stop
- if {ignore.%{_rd}%::%{_id}%} is {_id}:
- send "&9----------------------------------------------------" to {_p}
- send "&cYou aren't allowed to send friend requests to this person!" to {_p}
- send "&9----------------------------------------------------" to {_p}
- stop
- if {friend.%{_id}%::%{_rd}%} is {_rd}:
- send "&9----------------------------------------------------" to {_p}
- send "&cYou're already friends with this person!" to {_p}
- send "&9----------------------------------------------------" to {_p}
- stop
- if {waitf.%{_id}%::%{_rd}%} is set:
- send "&9----------------------------------------------------" to {_p}
- send "&cPlease wait before sending this person another request!" to {_p}
- send "&9----------------------------------------------------" to {_p}
- stop
- if {waitf.%{_rd}%::%{_id}%} is set:
- {_p} command "/f accept %{_r}%"
- stop
- send "&9----------------------------------------------------" to {_p}
- send "&eYou sent a friend request to %{_r}%! They have 5 minutes to accept it!" to {_p}
- send "&9----------------------------------------------------" to {_p}
- set {waitf.%{_id}%::%{_rd}%} to now
- send "&9&m----------------------------------------------------" to {_r}
- send "&eFriend request from %{rankcolor2.%{_p}%}% %{name.%{_p}%}%" to {_r}
- console command "tellraw %{_r}% ["""",{""text"":""[ACCEPT]"",""bold"":true,""color"":""green"",""clickEvent"":{""action"":""run_command"",""value"":""/f accept %{_p}%""}},{""text"":"" "",""bold"":true,""color"":""green""},{""text"":""- "",""color"":""dark_gray""},{""text"":""[DENY]"",""bold"":true,""color"":""red"",""clickEvent"":{""action"":""run_command"",""value"":""/f deny %{_p}%""}},{""text"":"" "",""bold"":true,""color"":""red""},{""text"":""- "",""color"":""dark_gray""},{""text"":""[IGNORE]"",""bold"":true,""color"":""gray"",""clickEvent"":{""action"":""run_command"",""value"":""/ignore add %{_p}%""}}]"
- #send "&eClick to accept: &a&l[ACCEPT]" to {_r}
- #json("%{_r}%", "&eClick to accept: &a&l[ACCEPT]||cmd:/f accept %{_p}%")
- send "&9&m----------------------------------------------------" to {_r}
- wait 5 minutes
- if {friend.%{_id}%::%{_rd}%} is {_rd}:
- delete {waitf.%{_id}%::%{_rd}%}
- stop
- delete {waitf.%{_id}%::%{_rd}%}
- if {waitf.%{_id}%::%{_rd}%} is set:
- send "&9----------------------------------------------------" to {_p}
- send "&eYour friend request to %{rankcolor3.%{_r}%}% %{_r}% &ehas expired." to {_p}
- send "&9----------------------------------------------------" to {_p}
- send "&9----------------------------------------------------" to {_r}
- send "&eThe friend request from %{rankcolor3.%{_p}%}% %{_p}% &ehas expired." to {_r}
- send "&9----------------------------------------------------" to {_r}
- delete {waitf.%{_id}%::%{_rd}%}
- function fList(p: player):
- set {_id} to {_p}'s uuid
- send "&9----------------------------------------------------" to {_p}
- send centered "&6Friends(%number of {friend.%{_id}%::*}% Players)" to {_p}
- loop {friend.%{_id}%::*}:
- set {_a} to offline player from uuid loop-value
- if {_a} is online:
- if {_a} is in "world":
- set {_on::%loop-index%} to "%{rankcolor2.%{_a}%}% %{name.%{_a}%}% &eis in a Lobby"
- else if {_a} is in "ffa":
- set {_on::%loop-index%} to "%{rankcolor2.%{_a}%}% %{name.%{_a}%}% &eis in a FFA"
- else if {_a} is offline:
- set {_off::%loop-index%} to "%{rankcolor3.%{_a}%}% %{_a}% &cis currently offline"
- loop {_on::*}:
- send "%loop-value%" to {_p}
- loop {_off::*}:
- send "%loop-value%" to {_p}
- send "&9----------------------------------------------------" to {_p}
- function fAccept(p: player, r: offline player):
- set {_id} to {_p}'s uuid
- set {_rd} to {_r}'s uuid
- if {friend.%{_id}%::%{_rd}%} is {_rd}:
- send "&9----------------------------------------------------" to {_p}
- send "&cYou're already friends with this person!" to {_p}
- send "&9----------------------------------------------------" to {_p}
- stop
- if {waitf.%{_rd}%::%{_id}%} is not set:
- send "&9----------------------------------------------------" to {_p}
- send "&cThat person hasn't invited you to be friends! Try &e/friend add %{_r}%" to {_p}
- send "&9----------------------------------------------------" to {_p}
- stop
- send "&9----------------------------------------------------" to {_p}
- send "&aYou are now friends with %{rankcolor3.%{_r}%}% %{_r}%" to {_p}
- send "&9----------------------------------------------------" to {_p}
- send "&9----------------------------------------------------" to {_r}
- send "&aYou are now friends with %{rankcolor3.%{_p}%}% %{_p}%" to {_r}
- send "&9----------------------------------------------------" to {_r}
- delete {waitf.%{_id}%::%{_rd}%}
- delete {waitf.%{_rd}%::%{_id}%}
- set {friend.%{_id}%::%{_rd}%} to {_rd}
- set {friend.%{_rd}%::%{_id}%} to {_id}
- function fDecline(p: player, r: offline player):
- set {_id} to {_p}'s uuid
- set {_rd} to {_r}'s uuid
- if {friend.%{_id}%::%{_rd}%} is {_rd}:
- send "&9----------------------------------------------------" to {_p}
- send "&cYou're already friends with this person!" to {_p}
- send "&9----------------------------------------------------" to {_p}
- stop
- if {waitf.%{_rd}%::%{_id}%} is not set:
- send "&9----------------------------------------------------" to {_p}
- send "&cThat person hasn't invited you to be friends! Try &e/friend add %{_r}%" to {_p}
- send "&9----------------------------------------------------" to {_p}
- stop
- send "&9----------------------------------------------------" to {_p}
- send "&eDeclined %{_r}%'s friend request!" to {_p}
- send "&9----------------------------------------------------" to {_p}
- delete {waitf.%{_id}%::%{_rd}%}
- delete {waitf.%{_rd}%::%{_id}%}
- function fRemove(p: player, r: offline player):
- set {_id} to {_p}'s uuid
- set {_rd} to {_r}'s uuid
- if {friend.%{_id}%::%{_rd}%} is not {_rd}:
- send "&9----------------------------------------------------" to {_p}
- send "%{rankcolor3.%{_r}%}% %{_r}% &cisn't on your friends list!" to {_p}
- send "&9----------------------------------------------------" to {_p}
- stop
- if {friend.%{_id}%::%{_rd}%} is not set:
- send "&9----------------------------------------------------" to {_p}
- send "%{rankcolor3.%{_r}%}% %{_r}% &cisn't on your friends list!" to {_p}
- send "&9----------------------------------------------------" to {_p}
- stop
- else if {friend.%{_id}%::%{_rd}%} is {_rd}:
- send "&9----------------------------------------------------" to {_p}
- send "&eYou removed %{rankcolor3.%{_r}%}% %{_r}% &efrom your friends list!" to {_p}
- send "&9----------------------------------------------------" to {_p}
- send "&9----------------------------------------------------" to {_r}
- send "%{rankcolor3.%{_p}%}% %{_p}% &eremoved you from their friend list!" to {_r}
- send "&9----------------------------------------------------" to {_r}
- delete {friend.%{_id}%::%{_rd}%}
- delete {friend.%{_rd}%::%{_id}%}
- function fJoin(p: player):
- set {_id} to {_p}'s uuid
- loop all players:
- if {friend.%loop-player's uuid%::%{_id}%} is {_id}:
- send "%{rankcolor3.%{_p}%}% %{_p}% &ejoined the lobby!" to loop-player
- function fQuit(p: player):
- set {_id} to {_p}'s uuid
- loop all players:
- if {friend.%loop-player's uuid%::%{_id}%} is {_id}:
- send "%{rankcolor3.%{_p}%}% %{_p}% &eleft." to loop-player
- command /friend [<text>] [<offline player>]:
- aliases: f
- trigger:
- if arg 1 is not set:
- fHelp(player)
- stop
- else if arg 1 is set:
- if arg 1 is "help":
- fHelp(player)
- stop
- if arg 1 is "add":
- if arg 2 is set:
- if arg 2 is player:
- send "&9----------------------------------------------------" to player
- send "&eYou can't add yourself as a friend!" to player
- send "&9----------------------------------------------------" to player
- stop
- fReq(player, arg 2)
- stop
- else:
- send "&9----------------------------------------------------" to player
- send "&cInvalid usage! Valid usage: /friend add Player" to player
- send "&9----------------------------------------------------" to player
- stop
- if arg 1 is "list":
- set {_num} to 1
- $ thread
- loop {friend.%player's uuid%::*}:
- set {_player} to offline player from uuid loop-value
- if {_player} is online:
- set {_list::%{_num}%} to loop-value
- add 1 to {_num}
- loop {friend.%player's uuid%::*}:
- set {_player} to offline player from uuid loop-value
- if {_player} is offline:
- set {_list::%{_num}%} to loop-value
- add 1 to {_num}
- set {_loops} to 8
- if arg 2 is set:
- set {_n} to "%arg 2%" parsed as integer
- else:
- set {_n} to 1
- if {_n} is not set:
- send "&9----------------------------------------------------" to player
- send "&cInvalid page number!" to player
- send "&9----------------------------------------------------" to player
- stop
- if {_n} <= 0:
- send "&9----------------------------------------------------" to player
- send "&cPage number must be positive!" to player
- send "&9----------------------------------------------------" to player
- stop
- if {_n} <= 1:
- set {_min} to 1
- else:
- set {_min} to {_loops}*({_n}-1) + 1
- set {_max} to ceil(number of {_list::*} / {_loops})
- send "&9----------------------------------------------------" to player
- send centered "&6Friends (Page %{_n}% of %{_max}%)" to player
- loop {_loops} times:
- set {__i} to {_min} + loop-number - 1
- if {_list::%{__i}%} is not set:
- stop loop
- set {_hoge} to offline player from uuid {_list::%{__i}%}
- if {_hoge} is online:
- if {rankcolor3.%{_hoge}%} is "<gray>":
- send "%{rankcolor3.%{_hoge}%}%%{_hoge}% &eis in Revive FFA"
- else:
- send "%{rankcolor3.%{_hoge}%}% %{_hoge}% &eis in Revive FFA"
- if {_hoge} is offline:
- if {rankcolor3.%{_hoge}%} is "<gray>":
- send "%{rankcolor3.%{_hoge}%}%%{_hoge}% &cis currently offline"
- else:
- send "%{rankcolor3.%{_hoge}%}% %{_hoge}% &cis currently offline"
- send "&9----------------------------------------------------" to player
- stop
- if arg 1 is "accept":
- if arg 2 is set:
- if arg 2 is player:
- send "&9----------------------------------------------------" to player
- send "&eYou can't add yourself as a friend!" to player
- send "&9----------------------------------------------------" to player
- stop
- else:
- fAccept(player, arg 2)
- stop
- else:
- send "&9----------------------------------------------------" to player
- send "&cInvalid usage! Valid usage: /friend accept Player" to player
- send "&9----------------------------------------------------" to player
- stop
- if arg 1 is "deny":
- if arg 2 is set:
- if arg 2 is player:
- send "&9----------------------------------------------------" to player
- send "&eYou can't deny yourself as a friend!" to player
- send "&9----------------------------------------------------" to player
- stop
- else:
- fDecline(player, arg 2)
- stop
- else:
- send "&9----------------------------------------------------" to player
- send "&cInvalid usage! Valid usage: /friend deny Player" to player
- send "&9----------------------------------------------------" to player
- stop
- if arg 1 is "remove":
- if arg 2 is set:
- if arg 2 is player:
- send "&9----------------------------------------------------" to player
- send "&eYou can't remove yourself as a friend!" to player
- send "&9----------------------------------------------------" to player
- stop
- else:
- fRemove(player, arg 2)
- stop
- else:
- send "&9----------------------------------------------------" to player
- send "&cInvalid usage! Valid usage: /friend remove Player" to player
- send "&9----------------------------------------------------" to player
- stop
- else:
- set {_a} to "%arg 1%" parsed as offline player
- if {_a} is player:
- send "&9----------------------------------------------------" to player
- send "&eYou can't add yourself as a friend!" to player
- send "&9----------------------------------------------------" to player
- stop
- if {_a} is online:
- fReq(player, {_a})
- stop
- else:
- fHelp(player)
- stop
- command /fl [<text>]:
- trigger:
- set {_num} to 1
- $ thread
- loop {friend.%player's uuid%::*}:
- set {_player} to offline player from uuid loop-value
- if {_player} is online:
- set {_list::%{_num}%} to loop-value
- add 1 to {_num}
- loop {friend.%player's uuid%::*}:
- set {_player} to offline player from uuid loop-value
- if {_player} is offline:
- set {_list::%{_num}%} to loop-value
- add 1 to {_num}
- set {_loops} to 8
- if arg 1 is set:
- set {_n} to "%arg 1%" parsed as integer
- else:
- set {_n} to 1
- if {_n} is not set:
- send "&9----------------------------------------------------" to player
- send "&cInvalid page number!" to player
- send "&9----------------------------------------------------" to player
- stop
- if {_n} <= 0:
- send "&9----------------------------------------------------" to player
- send "&cPage number must be positive!" to player
- send "&9----------------------------------------------------" to player
- stop
- if {_n} <= 1:
- set {_min} to 1
- else:
- set {_min} to {_loops}*({_n}-1) + 1
- set {_max} to ceil(number of {_list::*} / {_loops})
- send "&9----------------------------------------------------" to player
- send centered "&6Friends (Page %{_n}% of %{_max}%)" to player
- loop {_loops} times:
- set {__i} to {_min} + loop-number - 1
- if {_list::%{__i}%} is not set:
- stop loop
- set {_hoge} to offline player from uuid {_list::%{__i}%}
- if {_hoge} is online:
- if {rankcolor3.%{_hoge}%} is "<gray>":
- send "%{rankcolor3.%{_hoge}%}%%{_hoge}% &eis in Revive FFA"
- else:
- send "%{rankcolor3.%{_hoge}%}% %{_hoge}% &eis in Revive FFA"
- if {_hoge} is offline:
- if {rankcolor3.%{_hoge}%} is "<gray>":
- send "%{rankcolor3.%{_hoge}%}%%{_hoge}% &cis currently offline"
- else:
- send "%{rankcolor3.%{_hoge}%}% %{_hoge}% &cis currently offline"
- send "&9----------------------------------------------------" to player
- on join:
- fJoin(player)
- on quit:
- fQuit(player)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement