Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /timedrestart <integer>:
- permission: wlasciciel
- trigger:
- send "&2Wywolano funkcje restartu serwera za &c%arg% &2sekund"
- timedRestart(arg)
- function timedRestart(i: integer):
- if {_i} is not set:
- stop
- if {_i} >= 120:
- set {_t} to mod({_i}, 60)
- if {_t} > 0:
- loop {_t} times:
- wait 1 second
- set {_i} to floor({_i}/60) * 60
- broadcast "&6[&eMcSurvi.pl&6] &3Serwer zostanie zrestartowany za &b%{_i}/60% &3min."
- wait 1 minute
- remove 60 from {_i}
- set {_i} to "%{_i}%" parsed as integer
- timedRestart({_i})
- stop
- else if {_i} >= 60:
- set {_t} to mod({_i}, 60)
- if {_t} > 0:
- loop {_t} times:
- wait 1 second
- set {_i} to floor({_i}/60) * 60
- broadcast "&6[&eMcSurvi.pl&6] &3Serwer zostanie zrestartowany za &b60 &3sekund"
- wait 30 seconds
- remove 30 from {_i}
- timedRestart(30)
- stop
- else if {_i} >= 30:
- set {_t} to mod({_i}, 30)
- if {_t} > 0:
- loop {_t} times:
- wait 1 second
- broadcast "&6[&eMcSurvi.pl&6] &3Serwer zostanie zrestartowany za &b30 &3sekund"
- wait 15 seconds
- timedRestart(15)
- stop
- else if {_i} >= 15:
- set {_t} to mod({_i}, 15)
- if {_t} > 0:
- loop {_t} times:
- wait 1 second
- broadcast "&6[&eMcSurvi.pl&6] &3Serwer zostanie zrestartowany za &b15 &3sekund"
- wait 5 seconds
- timedRestart(10)
- stop
- else if {_i} >= 10:
- set {_t} to mod({_i}, 10)
- loop {_t} times:
- wait 1 second
- broadcast "&6[&eMcSurvi.pl&6] &3Serwer zostanie zrestartowany za &b10 &3sekund"
- wait 5 seconds
- timedRestart(5)
- stop
- else if {_i} >= 5:
- set {_t} to mod({_i}, 5)
- if {_t} > 0:
- loop {_t} times:
- wait 1 second
- broadcast "&6[&eMcSurvi.pl&6] &3Serwer zostanie zrestartowany za &b5 &3sekund"
- wait 1 second
- timedRestart(4)
- stop
- else if {_i} >= 4:
- broadcast "&6[&eMcSurvi.pl&6] &3Serwer zostanie zrestartowany za &b4 &3sekundy"
- wait 1 second
- timedRestart(3)
- stop
- else if {_i} >= 3:
- broadcast "&6[&eMcSurvi.pl&6] &3Serwer zostanie zrestartowany za &b3 &3sekundy"
- wait 1 second
- timedRestart(2)
- stop
- else if {_i} >= 2:
- broadcast "&6[&eMcSurvi.pl&6] &3Serwer zostanie zrestartowany za &b2 &3sekundy"
- wait 1 second
- timedRestart(1)
- stop
- else if {_i} >= 1:
- broadcast "&6[&eMcSurvi.pl&6] &3Serwer zostanie zrestartowany za &bsekunde"
- wait 1 second
- execute console command "restart"
- stop
Advertisement
Add Comment
Please, Sign In to add comment