restore_scores 1.4.0
This commit is contained in:
+11
-3
@@ -1,4 +1,4 @@
|
||||
global_version = '1.2.0';
|
||||
global_version = '1.4.0';
|
||||
__config() -> {
|
||||
'scope' -> 'global',
|
||||
'stay_loaded' -> false
|
||||
@@ -147,9 +147,13 @@ __restore(pl) ->(
|
||||
total_killed = 0;
|
||||
total_traded = 0;
|
||||
total_hurt = 0;
|
||||
failed_list = [];
|
||||
c_for(i = 0, i < length(pl), i += 1,
|
||||
run('player ' + pl:i + ' spawn');
|
||||
game_tick(50);
|
||||
if(player(pl:i) != pl:i,
|
||||
put(failed_list, length(failed_list), pl:i);
|
||||
);
|
||||
//滑翔距离
|
||||
//mc会统计多一倍的数据,所以除以200
|
||||
aviate = statistic(pl:i, 'custom', 'aviate_one_cm')/200;
|
||||
@@ -214,12 +218,16 @@ __restore(pl) ->(
|
||||
scoreboard('fz.aviate1m', '总滑翔距离', total_aviate);
|
||||
scoreboard('totalList', '总滑翔距离', total_aviate);
|
||||
game_tick(50);
|
||||
run('function fz:scoreboards/install')
|
||||
run('function fz:scoreboards/install');
|
||||
return(failed_list);
|
||||
);
|
||||
by_whitelist() ->(
|
||||
pl = keys(system_info('server_whitelist'));
|
||||
game_tick(50);
|
||||
__restore(pl);
|
||||
failed_list = __restore(pl);
|
||||
if(failed_list != [],
|
||||
print(' : ( 这些玩家恢复失败了:' + failed_list);
|
||||
);
|
||||
print('完成!');
|
||||
return()
|
||||
)
|
||||
Reference in New Issue
Block a user