command /konkurs [] [] []: trigger: if arg 1 is not set: send "/konkurs dolacz " send "/konkurs lista" if sender has permission "konkurs.admin": send "/konkurs stworz " send "/konkurs losuj - losuje arg 3 graczy z losowania arg 2" send "/konkurs zakoncz " send "/konkurs lista - ile osob jest na konkursie." stop if arg 1 is "lista": if arg 2 is set: if sender has permission "konkurs.admin": if arg 2 parsed as integer is not integer: send "Podaj liczbe!" stop if {konkurs::%arg 2%} is set: send "Liczba osob na konkursie nr %arg 2%: %size of {konkurs::%arg 2%::*}%" stop send "Nie ma konkursu o nr %arg 2%" stop if size of {konkurs::*} is larger than 0: send "Dostepne konkursy: %{konkurs::*}%" stop send "Nie ma obecnie konkursow." stop if arg 1 is set: if arg 2 is not set: send "Podaj nr" stop if arg 2 parsed as integer is not integer: send "Musisz podac numer!" stop #Arg 2 juz jest podany. if arg 1 is "dolacz": if {konkurs::%arg 2%} is set: if {konkurs::%arg 2%::*} contains player: send "Juz jestes w tym konkursie!" stop add player to {konkurs::%arg 2%::*} send "Zapisales sie do konkursu." stop send "Nie ma konkursu o nr %arg 2%" stop if sender has permission "konkurs.admin": if arg 1 is "stworz": if {konkurs::%arg 2%} is set: send "Juz jest taki konkurs o tym nr" stop set {konkurs::%arg 2%} to arg 2 broadcast "Rozpoczal sie konkurs! /konkurs %arg 2%" stop if arg 1 is "losuj": if {konkurs::%arg 2%} is not set: send "Nie ma takiego konkursu." stop if arg 3 is not set: send "Podaj ilosc graczy do wygrania." stop set {_arg3} to arg 3 parsed as integer if {_arg3} is not integer: send "Argument 3 nie jest liczba." stop if size of {konkurs::%arg 2%::*} is 0: send "Nie ma uczestnikow konkursu." stop if size of {konkurs::%arg 2%::*} is smaller than {_arg3}: send "Jest mniej uczestnikow niz dostepnych nagrod! Rozdajemy im wszystkim." set {_arg3} to size of {konkurs::%arg 2%::*} set {_gracze::*} to {konkurs::%arg 2%::*} loop {_arg3} times: set {_randomPlayer} to random player out of {_gracze::*} send "Wygrales w konkursie nr %arg 2%." to {_randomPlayer} give dirt to {_randomPlayer} #tutaj nagroda. remove {_randomPlayer} from {_gracze::*} stop if arg 1 is "zakoncz": if {konkurs::%arg 2%} is not set: send "Nie ma takiego konkursu." stop send "Konkurs %arg 2% zakonczyl sie." to {konkurs::%arg 2%::*} send "Zakonczyles konkurs nr %arg 2%" delete {konkurs::%arg 2%::*} delete {konkurs::%arg 2%} stop