options: aMin: 0 aMax: 100 bMin: 0 bMax: 100 cMin: 2 cMax: 10 konkurs.wygasl: 60 second nagroda: 1 diamond pickaxe of efficiency 6 and unbreaking 3 and fortune 3 variables: {konkurs} = false command /konkurs []: trigger: if arg 1 is set: if arg 1 is "start": if player has permissions "konkurs.admin": if {konkurs} is false: set {a} to random integer between {@aMin} and {@aMax} set {b} to random integer between {@bMin} and {@bMax} set {c} to random integer between {@cMin} and {@cMax} set {d} to {a} + {b} * {c} set {konkurs} to true send "&8&l[&a&lKONKURS&8&l] &7Kto pierwszy obliczy ile to &f%{a}% + %{b}% * %{c}% &7dostanie nagrode!" to all players wait {@konkurs.wygasl} if {konkurs} is true: set {konkurs} to false send "&8&l[&a&lKONKURS&8&l] &7Nikt nie obliczyl w ciagu minuty ile to &f%{a}% + %{b}% * %{c}% &7wiec konkurs zostal zakonczony!" to all players clear {a} clear {b} clear {c} clear {d} stop if {konkurs} is true: send "&8&l[&a&lKONKURS&8&l] &4Trwa juz konkurs!" stop else: send "&4Nie masz uprawnien kolego" if arg 1 is not "start": send "&cPoprawne uzycie: &f/konkurs" stop if arg 1 is not set: if {konkurs} is false: send "&c&lAktualnie nie trwa zaden konkurs!" stop if {konkurs} is true: send "&a&lAktualnie trwa konkurs! Trzeba obliczyc ile to %{a}% + %{b}% * %{c}%!" stop every 30 minutes: if {konkurs} is false: set {a} to random integer between {@aMin} and {@aMax} set {b} to random integer between {@bMin} and {@bMax} set {c} to random integer between {@cMin} and {@cMax} set {d} to {a} + {b} * {c} set {konkurs} to true send "&8&l[&a&lKONKURS&8&l] &7Kto pierwszy obliczy ile to &f%{a}% + %{b}% * %{c}% &7dostanie nagrode!" to all players wait {@konkurs.wygasl} if {konkurs} is true: set {konkurs} to false send "&8&l[&a&lKONKURS&8&l] &7Nikt nie obliczyl w ciagu minuty ile to &f%{a}% + %{b}% * %{c}% &7wiec konkurs zostal zakonczony!" to all players clear {a} clear {b} clear {c} clear {d} on chat: if {konkurs} is true: if message is "%{d}%": cancel event set {konkurs} to false clear {a} clear {b} clear {c} clear {d} send "&8&l[&a&lKONKURS&8&l] &fGratulacje!&7 udalo Ci sie wygrac konkurs!" send "&8&l[&a&lKONKURS&8&l] &7Konkurs wygral &f%player%&7!" to all players add {@nagroda} to player's inventory