#Sets header and footer of a player's tablist with packets
#Parameters:
#{_target} = player that this function will change the header and footer of his tablist view.
#{_header} = the text at the header part of the tablist that will be showed to the player's tablist view
#{_footer} = the text at the footer part of the tablist that will be showed to the player's tablist view
#Examples:
#can be seen below
function packetTabHeaderAndFooter(target: player, header: text, footer: text):
set {_packet} to new play_server_player_list_header_footer packet
#The following needs of Json.sk to work
set "chatcomponent" pjson 0 of {_packet} to jsonFormat({_header})
set "chatcomponent" pjson 1 of {_packet to jsonFormat({_footer})
send {_target} packet {_packet}
on join:
wait 3 ticks
#set up
packetTabHeaderAndFooter(player, "&3&lValux Network", "&3Website&7: &bvalux.net &3Store&7: &bstore.valux.net &3TS&7: &bts.valux.net")
hide all players in tablist of player
set amount of columns in player's tablist to 4
set amount of rows in player's tablist to 20
#Webiste
set tab 1, 1 of player to "<cyan>Website<grey>:"
set tab 1, 2 of player to "<aqua>valux.net"
#Rank
set name of tab 1, 4 of player to "<cyan>Rank<grey>:"
set name of tab 1, 5 of player to "%player's prefix%" #needs of Vault and a permission manager that supports Vault
#Server
set name of tab 1, 7 of player to "<cyan>Server<grey>:"
set name of tab 1, 8 of player to "<aqua>%current server of player's uuid%" #Needs of SkellettProxy and Skellett properly set up
#Teamspeak
set name of tab 2, 1 of player to "<cyan>Teamspeak<grey>:"
set name of tab 2, 2 of player to "<aqua>ts.valux.net"
#Store
set name of tab 3, 1 of player to "<cyan>Store<grey>:"
set name of tab 3, 2 of player to "<aqua>shop.valux.net"