|
@@ -27,6 +27,7 @@ colorcodedeath = "§9";
|
|
death_prefix = "§0§lx §r";
|
|
death_prefix = "§0§lx §r";
|
|
headlist = list.new();
|
|
headlist = list.new();
|
|
headlist2 = list.new();
|
|
headlist2 = list.new();
|
|
|
|
+rank_playtime_list = list.new();
|
|
|
|
|
|
defaultdeaths = list.new();
|
|
defaultdeaths = list.new();
|
|
list.add(defaultdeaths, concat(colorcodedeath, " bled out."));
|
|
list.add(defaultdeaths, concat(colorcodedeath, " bled out."));
|
|
@@ -74,12 +75,13 @@ map.add(causetolist, "lava", firedeaths);
|
|
map.add(causetolist, "flyIntoWall", flydeaths);
|
|
map.add(causetolist, "flyIntoWall", flydeaths);
|
|
map.add(causetolist, "player", list.new());
|
|
map.add(causetolist, "player", list.new());
|
|
|
|
|
|
-setScriptVar("rank_playtime_list", list.new());
|
|
|
|
online_list = players.toList();
|
|
online_list = players.toList();
|
|
iter = list.iterator(online_list);
|
|
iter = list.iterator(online_list);
|
|
while(hasNext(iter)) {
|
|
while(hasNext(iter)) {
|
|
rank.offerTimeScheduled(next(iter));
|
|
rank.offerTimeScheduled(next(iter));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+sgoto(1200, "minute_loop");
|
|
|
|
|
|
msg("dev", "§bChat §rloaded");
|
|
msg("dev", "§bChat §rloaded");
|
|
@wait
|
|
@wait
|
|
@@ -264,7 +266,7 @@ goto("wait");
|
|
|
|
|
|
function rank.removeTimeOffert(player) {
|
|
function rank.removeTimeOffert(player) {
|
|
player_uuid = player.getUuid(player);
|
|
player_uuid = player.getUuid(player);
|
|
- list = getScriptVar("rank_playtime_list");
|
|
|
|
|
|
+ list = $rank_playtime_list;
|
|
for(i = 0; i < list.getSize(list); i++) {
|
|
for(i = 0; i < list.getSize(list); i++) {
|
|
a = list.getIndex(list, i);
|
|
a = list.getIndex(list, i);
|
|
if(player_uuid == a[0]) {
|
|
if(player_uuid == a[0]) {
|
|
@@ -275,8 +277,7 @@ function rank.removeTimeOffert(player) {
|
|
}
|
|
}
|
|
|
|
|
|
function rank.offerTimeScheduled(player) {
|
|
function rank.offerTimeScheduled(player) {
|
|
- list = getScriptVar("rank_playtime_list");
|
|
|
|
- a = array.new(2);
|
|
|
|
|
|
+ a = array.new(3);
|
|
a[0] = player.getUuid(player);
|
|
a[0] = player.getUuid(player);
|
|
playtime = playtime.getPlayerTotal(player);
|
|
playtime = playtime.getPlayerTotal(player);
|
|
if(playtime < 1200) {
|
|
if(playtime < 1200) {
|
|
@@ -294,21 +295,25 @@ function rank.offerTimeScheduled(player) {
|
|
if(diff > 1440) {
|
|
if(diff > 1440) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- list.add(list, a);
|
|
|
|
- sgoto(diff * 60 * 20, "offerTimeRank");
|
|
|
|
|
|
+ a[2] = time.getMillis() * diff * 60 * 1000;
|
|
|
|
+ list.add($rank_playtime_list, a);
|
|
}
|
|
}
|
|
|
|
|
|
-@offerTimeRank
|
|
|
|
-list = getScriptVar("rank_playtime_list");
|
|
|
|
-if(list.getSize(list) == 0) {
|
|
|
|
- goto("wait");
|
|
|
|
-}
|
|
|
|
-a = list.getIndex(list, 0);
|
|
|
|
-list.removeIndex(list, 0);
|
|
|
|
-player_uuid = a[0];
|
|
|
|
-tech_name = a[1];
|
|
|
|
-player = player.get(player_uuid);
|
|
|
|
-if(player != null) {
|
|
|
|
- offerRank(player, tech_name);
|
|
|
|
|
|
+@minute_loop
|
|
|
|
+now_time = time.getMillis();
|
|
|
|
+iter = list.iterator($rank_playtime_list);
|
|
|
|
+while(hasNext(iter)) {
|
|
|
|
+ a = next(iter);
|
|
|
|
+ player_uuid = a[0];
|
|
|
|
+ tech_name = a[1];
|
|
|
|
+ time = a[2];
|
|
|
|
+ if(time < now_time) {
|
|
|
|
+ player = player.get(player_uuid);
|
|
|
|
+ if(player != null) {
|
|
|
|
+ offerRank(player, tech_name);
|
|
|
|
+ }
|
|
|
|
+ remove(iter);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+sgoto(1200, "minute_loop");
|
|
goto("wait");
|
|
goto("wait");
|