View difference between Paste ID: 7XXGKACk and vv6HWA9P
SHOW: | | - or go back to the newest paste.
1
options:
2
	Anuncios: 4
3
	TempoEntre: 10
4
	Tag: &6&l[Loteria]&e
5
	hora: 21
6
	minuto: 20
7
8
variables:
9
	{Loteria.iniciada} = false
10
11
command /loteriainiciar [<integer>] [<integer>]:
12
	permission: warspvp.loterianiciar
13
	executable by: player and console
14
	trigger:
15
		set {Loteria.iniciada} to true
16
		set {Loteria.numero_vencedor} to a random integer between 1 and 999
17
		set {Loteria.premio} to 15000
18
		loop {@Anuncios} times:
19
			if {Loteria.iniciada} is true:
20
				broadcast " "
21
				broadcast "{@Tag} Esta aberto! Premio: %{Loteria.premio}%"
22
				broadcast "{@Tag} Para tentar a sorte use: /loteria [numero]!"
23
				send "&c&l[Loteria] &cNumero correto: %{Loteria.numero_vencedor}%" to all ops
24
				broadcast " "
25
				wait {@TempoEntre} seconds
26
		if {Loteria.iniciada} is true:
27
			if {Loteria.vencedor} is false:
28
				set {Loteria.iniciada} to false
29
				broadcast " "
30
				broadcast "{@Tag} A Loteria acabou! Ninguem acertou no numero correto!"
31
				broadcast "{@Tag} Numero Correto: %{Loteria.numero_vencedor}%!"
32
				broadcast " "
33
				wait 1 tick
34
				clear {Loteria.numero_vencedor}
35
				clear {Loteria.vencedor}
36
37
command /loteria [<integer>]:
38
	trigger:
39
		if {Loteria.iniciada} is true:
40
			if argument 1 is set:
41
				if {Loteria.numero_vencedor} = arg 1:
42
					set {Loteria.vencedor} to true
43
					set {Loteria.iniciada} to false
44
					broadcast " "
45
					broadcast "{@Tag} Temos um vencedor!"
46
					broadcast " "
47
					wait 1 second
48
					broadcast " "
49
					broadcast "{@Tag} O jogador &6%player% &eganhou a loteria!"
50
					broadcast "{@Tag} Premio: %{Loteria.premio}%"
51
					broadcast "{@Tag} O numero sorteado era: &6%{Loteria.numero_vencedor}%"
52
					broadcast " "
53
					
54
					clear {Loteria.premio}
55
					clear {Loteria.numero_vencedor}
56
				else:
57
					send "&6[Loteria] &eErroouu, tente outra vez."
58
					stop
59
			else:
60
				send "{@Tag} &eUse /loteria <numero>"
61
		else:
62
			send "{@Tag} &eNao esta a ocorrer nenhuma loteria."
63
			stop
64
65
command /loteriacancelar:
66
	trigger:
67
		if player has permission "warspvp.loteriacancelar":
68
			if {Loteria.iniciada} is true:
69
				set {Loteria.iniciada} to false
70
				set {Loteria.vencedor} to false
71
				clear {Loteria.premio}
72
				clear {Loteria.numero_vencedor}
73
				broadcast " "
74
				broadcast "{@Tag} O evento foi cancelado por: &6%player% &e!"
75
				broadcast "{@Tag} Outro evento ira ocorrer em outra hora."
76
				broadcast " "
77
				stop
78
			else:
79
				send "{@Tag} Nenhuma loteria está aberta."
80
				stop
81
		else:
82
			send "{@Tag} Voce nao tme permissao para fazer isto!"
83
			stop
84
85
command /loteriadesbugar:
86
	trigger:
87
		if player has permission "warspvp.loteriadesbugar":
88
			if {Loteria.iniciada} is true:
89
				send "{@Tag} A loteria nao pode estar a decorrer!"
90
				stop
91
			if {Loteria.iniciada} is false:
92
				send "&6[Loteria] &cA desbugar..."
93
				wait 1 tick
94
				set {Loteria.iniciada} to false
95
				set {Loteria.vencedor} to false
96
				clear {Loteria.premio}
97
				clear {Loteria.numero_vencedor}
98
				wait 1 tick
99
				send "&6[Loteria] &aloteria desbugada com sucesso!"
100
				stop
101
		else:
102
			send "{@Tag} Voce nao tem permissao para fazer isto!"
103
			stop
104
					
105
every 60 seconds:
106-
    set {_now} to "%now%"
106+
	set {_now} to "%now%"
107-
    set {date.time::*} to {now} split at " "
107+
	set {date.time::*} to {now} split at " "
108-
    set {date::*} to {date.time::1} split at "/"
108+
	set {date::*} to {date.time::1} split at "/"
109-
    set {time::*} to {date.time::2} split at ":"
109+
	set {time::*} to {date.time::2} split at ":"
110-
    set {time.hour} to {_time::1}
110+
	set {time.hour} to {_time::1}
111-
    set {time.minute} to {_time::2}
111+
	set {time.minute} to {_time::2}
112-
    set {date.weekday} to {_date::4}
112+
	set {date.weekday} to {_date::4}
113-
    set {date.month} to {_date::2}
113+
	set {date.month} to {_date::2}
114-
    set {date.year} to {_date::3}
114+
	set {date.year} to {_date::3}
115-
    if {time.hour} is "{@hora}":
115+
	if {time.hour} is "{@hora}":
116-
        if {time.minute} is "{@minuto}":
116+
		if {time.minute} is "{@minuto}":
117-
            make console execute command "loteriainiciar"
117+
			execute console command "/loteriainiciar"