Code: Select all
proc start:cup {nick host hand chan text} {
global cup
set cup(slots,$chan) [lindex [split $text] 2]
set cup(prize,$chan) [join [lrange [split $text] 3 end]]
set cup(type,$chan) [lindex [split $text] 1]
set cup(admin,$chan) $nick
set cup(map,$chan) de_dust2
if {![matchattr $handle o|o $chan] && ![matchattr $handle C|C $chan]} {
putserv "PRIVMSG $chan :Error: you do not have access to this command $nick."
} elseif {[matchattr $handle o|o $chan] || [matchattr $handle C|C $chan] && ($cup(cup,$chan) == on)} {
putserv "PRIVMSG $chan :Error: a cup is already running, use ./!/?stop to stop the cup."
} elseif {[matchattr $handle o|o $chan] || [matchattr $handle C|C $chan] && ($cup(cup,$chan) == off)} {
set cup(cup,$chan) on
if {($cup(type,$chan) != 1on1) && ($cup(type,$chan) != 2on2) && ($cup(type,$chan) != 5on5)} && ($cup(type,$chan) == "") {
putserv "PRIVMSG $chan :Error: No cup type was given, or invalid entery, please use ./!/?start 1on1/2on2/5on5 4/8/16/32 prize."
} elseif {($cup(slots,$chan) == "")} {
putserv "PRIVMSG $chan :Error: no slots was given, please use ./!/?start slots prize."
} elseif {($cup(prize,$chan) == ""} {
putserv "PRIVMSG $chan :Error: no prize was given, please use ./!/?start slots prize."
} elseif {$cup(slots,$chan) != "") && ($cup(prize,$chan) != "")} && ($cup(type,$chan) != "") {
putserv "PRIVMSG $chan :The $chan $cup(type,$chan) cup has begun with $cup(slots,$chan) slots."
putserv "PRIVMSG $chan :Your admin is: $cup(admin,$chan) and the map is $cup(map,$chan)."
}
}
}
I cant find the error in this script, i have tryed fixing it, it still dont work. Maybe im not looking hard enough ;p please help, Thanks in advance!!