From 5b852342b28a6639040c5a6c6f5df82baf5811b1 Mon Sep 17 00:00:00 2001 From: Anorak_1 Date: Wed, 9 Nov 2022 16:39:34 +0100 Subject: [PATCH] Added reset of all team and player specific variables to gama_status "init" --- plugins/scripts/scripts/skybattle.sk | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/scripts/scripts/skybattle.sk b/plugins/scripts/scripts/skybattle.sk index 89b4172..259fcce 100644 --- a/plugins/scripts/scripts/skybattle.sk +++ b/plugins/scripts/scripts/skybattle.sk @@ -21,7 +21,7 @@ # ---------------- Variables specific for each team ---------------- # skybattle::team[1-10]:: - folders for all variables specific to each team (list of players, etc.) -#! skybattle::team[1-10]::players - stores every player from team [list of players] +# skybattle::team[1-10]::players - stores every player from team [list of players] - probably implemented on minigame startup #! skybattle::team[1-10]::alive_players - list of players alive #! skybattle::team[1-10]::alive_number - number of players alive in team [int] #! skybattle::team[1-10]::kills - number of kills of the whole team [int] @@ -45,6 +45,7 @@ command /minigame_skybattle_start: loop 10 times: loop entries of team "IDList%loop-number%": add loop-value2 to {skybattle::gaming_players::*} + add loop-value2 to {skybattle::team%%loop-number::players::*} broadcast "Načítám minihru Sky Battle" send title "§2Sky Battle" to all players set {skybattle::game_status} to "init" @@ -68,6 +69,9 @@ command /minigame_skybattle_start: if {skybattle::game_status} is "init": execute console command "/scoreboard players set MaxKolo XD 9" + resetplayers() + resetteams() + command /skybattle_setborder : description: Set center of border for map x usage: /skybattle_setborder @@ -155,6 +159,13 @@ function spawnteam(team: integer, spawner: integer): # !!! POPULATE INVENTORY !!! +function resetteams(): + loop 10 times: + clear {skybattle::team%loop-value%::*} + +function resetplayers(): + clear {skybattle::players::*} + on death of player: # victim, attacker add victim's uuid to {skybattle::deadplayers::*}