Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- Anuncios: 4
- TempoEntre: 10
- Tag: &6&l[Loteria]&e
- hora: 21
- minuto: 20
- variables:
- {Loteria.iniciada} = false
- command /loteriainiciar [<integer>] [<integer>]:
- permission: warspvp.loterianiciar
- executable by: player and console
- trigger:
- set {Loteria.iniciada} to true
- set {Loteria.numero_vencedor} to a random integer between 1 and 999
- set {Loteria.premio} to 15000
- loop {@Anuncios} times:
- if {Loteria.iniciada} is true:
- broadcast " "
- broadcast "{@Tag} Esta aberto! Premio: %{Loteria.premio}%"
- broadcast "{@Tag} Para tentar a sorte use: /loteria [numero]!"
- send "&c&l[Loteria] &cNumero correto: %{Loteria.numero_vencedor}%" to all ops
- broadcast " "
- wait {@TempoEntre} seconds
- if {Loteria.iniciada} is true:
- if {Loteria.vencedor} is false:
- set {Loteria.iniciada} to false
- broadcast " "
- broadcast "{@Tag} A Loteria acabou! Ninguem acertou no numero correto!"
- broadcast "{@Tag} Numero Correto: %{Loteria.numero_vencedor}%!"
- broadcast " "
- wait 1 tick
- clear {Loteria.numero_vencedor}
- clear {Loteria.vencedor}
- command /loteria [<integer>]:
- trigger:
- if {Loteria.iniciada} is true:
- if argument 1 is set:
- if {Loteria.numero_vencedor} = arg 1:
- set {Loteria.vencedor} to true
- set {Loteria.iniciada} to false
- broadcast " "
- broadcast "{@Tag} Temos um vencedor!"
- broadcast " "
- wait 1 second
- broadcast " "
- broadcast "{@Tag} O jogador &6%player% &eganhou a loteria!"
- broadcast "{@Tag} Premio: %{Loteria.premio}%"
- broadcast "{@Tag} O numero sorteado era: &6%{Loteria.numero_vencedor}%"
- broadcast " "
- clear {Loteria.premio}
- clear {Loteria.numero_vencedor}
- else:
- send "&6[Loteria] &eErroouu, tente outra vez."
- stop
- else:
- send "{@Tag} &eUse /loteria <numero>"
- else:
- send "{@Tag} &eNao esta a ocorrer nenhuma loteria."
- stop
- command /loteriacancelar:
- trigger:
- if player has permission "warspvp.loteriacancelar":
- if {Loteria.iniciada} is true:
- set {Loteria.iniciada} to false
- set {Loteria.vencedor} to false
- clear {Loteria.premio}
- clear {Loteria.numero_vencedor}
- broadcast " "
- broadcast "{@Tag} O evento foi cancelado por: &6%player% &e!"
- broadcast "{@Tag} Outro evento ira ocorrer em outra hora."
- broadcast " "
- stop
- else:
- send "{@Tag} Nenhuma loteria está aberta."
- stop
- else:
- send "{@Tag} Voce nao tme permissao para fazer isto!"
- stop
- command /loteriadesbugar:
- trigger:
- if player has permission "warspvp.loteriadesbugar":
- if {Loteria.iniciada} is true:
- send "{@Tag} A loteria nao pode estar a decorrer!"
- stop
- if {Loteria.iniciada} is false:
- send "&6[Loteria] &cA desbugar..."
- wait 1 tick
- set {Loteria.iniciada} to false
- set {Loteria.vencedor} to false
- clear {Loteria.premio}
- clear {Loteria.numero_vencedor}
- wait 1 tick
- send "&6[Loteria] &aloteria desbugada com sucesso!"
- stop
- else:
- send "{@Tag} Voce nao tem permissao para fazer isto!"
- stop
- every 60 seconds:
- set {_now} to "%now%"
- set {date.time::*} to {now} split at " "
- set {date::*} to {date.time::1} split at "/"
- set {time::*} to {date.time::2} split at ":"
- set {time.hour} to {_time::1}
- set {time.minute} to {_time::2}
- set {date.weekday} to {_date::4}
- set {date.month} to {_date::2}
- set {date.year} to {_date::3}
- if {time.hour} is "{@hora}":
- if {time.minute} is "{@minuto}":
- make console execute command "loteriainiciar"
Advertisement
Add Comment
Please, Sign In to add comment