This code works uncompletely as it starts timers activated , But after 55 seconds from voting no warning message appear and the timers halted and no kicking occure , no %voting counting , so what's the wrong
on *:text:!votekick*:*: {
if $nick isop $chan {
if %vote != 0 {
msg $chan There is a voting running already
halt
}
if $2 == $me {
msg $chan I won't start a votekick on myself, $nick $+ ...
}
else {
if $2 ison $chan {
set %vote $chan
msg $chan $+ $nick has started a votekick against $2
msg $chan Type !vote yes/no to vote for/against the kick
msg $chan You can only vote one time and you have [60] seconds to do so
timer 1 55 _warning $chan
timer 1 60 _vote $chan
set %victim $2
}
else {
msg $chan I don't see $2 in $chan $+ ?!
}
}
}
else {
msg $chan You do not have permission to do start a votekick!
}
}
on *:nick: {
if $nick == %victim && %vote != 0 {
msg %vote There's no way to hide, $newnick $+ !
set %victim $newnick
}
}
on *:text:!vote*:*: {
if $read(votekick.txt,s,$address) {
msg $chan You have voted already, $nick $+ !
}
else {
if $2 == $null {
if %vote == 0 {
msg $chan No voting running at the moment
}
else {
msg $chan Syntax: !vote yes/no
}
}
elseif $2 == yes {
if %vote == 0 {
msg $chan No voting running at the moment
}
else {
inc %yes
write votekick.txt $address $address
}
}
elseif $2 == no {
if %vote == 0 {
msg $chan No voting running at the moment
}
else {
inc %no
write votekick.txt $address $address
}
}
else {
if %vote == 0 {
msg $chan No voting running at the moment
}
else {
msg $chan Syntax: !vote yes/no
}
}
}
}
on *:text:!victim*:*: {
if %vote == 0 {
msg $chan No voting running at the moment
}
else {
msg $chan The current votekick victim is %victim
}
}
alias _warning {
if %vote != 0 {
msg $1 5 seconds remaining
}
}
alias _vote {
if %vote != 0 {
var %total = $calc(%yes + %no)
var %yes-p = $round($calc(%yes / %total * 100),2)
var %no-p = $round($calc(%no / %total * 100),2)
msg $1 The vote is over! The victim was %victim
msg $1 Total votes: %total - Yes: %yes ( $+ %yes-p $+ $chr(37) $+ ) - No: %no ( $+ %no-p $+ $chr(37) $+ )
if %yes > %no {
kick $1 %victim votekicked
}
else {
msg $1 You are lucky this time, %victim;)
}
set %vote 0
set %yes 0
set %no 0
unset %all
remove votekick.txt
}
}
on *:text:!stopvoting:*: {
if %vote == 0 {
msg $chan No voting running at the moment
}
else {
if $nick isop $chan {
set %vote 0
set %yes 0
set %no 0
unset %all
remove votekick.txt
msg $chan The voting has been stopped by $nick
}
else {
msg $chan You do not have permission to stop the voting!
}
}
}