Code: Select all
bind pub - !add cup:add
proc cup:add {nick host hand chan text} {
if {![channel get $chan "cup"]} {
putserv "PRIVMSG $chan :Error: $nick there is no cup runnnig."
} elseif {[channel get $chan "cup"]} {
set teamname [lindex [split $text] 5]
set p1 [lindex [split $text] 1]
set p2 [lindex [split $text] 2]
set p3 [lindex [split $text] 3]
set p4 [lindex [split $text] 4]
if {([channel get $chan "s_cup_type"] == 5on5)} {
blah
} elseif 4on4 2on3 2on2 1on1 etc {
blah
} else {
list $teamname $nick $p1 $p2 $p3 $p4
putserv "PRIVMSG $chan :$nick signed up $p1 & $2 & $p3 & $p4 as team: $teamname."
}
}
Would that work, please help
Thanks in advance!! im a nuub and list operations!
Code: Select all
proc cup:start {nick host hand chan text} {
if {[matchattr $hand C|C $chan]} {
if {[channel get $chan "cup"]} {
putserv "PRIVMSG $chan :Error: Cup is already running."
} elseif {![channel get $chan "cup"]} {
set cup(slots,$chan) [lindex [split $text] 1]
set cup(type,$chan) [lindex [split $text] 0]
set cup(prize,$chan) [join [lrange [split $text] 2 end]]
if {($cup(type,$chan) != "5on5") && ($cup(type,$chan) != "4on4") && ($cup(type,$chan) != "3on3") && ($cup(type,$chan) != "2on2") && ($cup(type,$chan) != "1on1") && ($cup(type,$chan) == "")} {
putserv "NOTICE $nick :Error: Please enter a correct cup type. ( 5on5 or 4on4 or 3on3 or 2on2 or 1on1 )"
} elseif {($cup(slots,$chan) != "4") && ($cup(slots,$chan) != "8") && ($cup(slots,$chan) != "16") && ($cup(slots,$chan) != "32") && ($cup(slots,$chan) == "")} {
putserv "NOTICE $nick :Error: Please enter a correct slot entry. ( 4 or 8 or 16 or 32 )"
} elseif {($cup(prize,$chan) == "")} {
putserv "NOTICE $nick Error: Please enter a prize. ( prize can be anything )"
} else {
channel set $chan +cup
channel set $chan s_cup_slots $cup(slots,$chan)
channel set $chan s_cup_type $cup(type,$chan)
channel set $chan s_cup_prize $cup(prize,$chan)
channel set $chan s_cup_teams 0
channel set $chan s_cup_admin $nick
channel set $chan s_cup_HLTV None set
channel set $chan s_cup_maps de_dust2
putserv "PRIVMSG $chan :The $chan [channel get $chan "s_cup_type"] is now on with [channel get $chan "s_cup_slots"] slots."
putserv "PRIVMSG $chan :Your admin is [channel get $chan "s_cup_admin"] and the map is [channel get $chan "s_cup_maps"]."
putserv "PRIVMSG $chan :Bot by #cupcentrum join to request your bot."
} else {
putserv "NOTICE $nick :Error: you do not have access to this command."
}
}
}
}
Code: Select all
if {[matchattr $hand C|C $chan]} {
Code: Select all
if {[matchattr $hand |C $chan]} {
Code: Select all
proc cup:start {nick host hand chan text} {
if {[matchattr $hand |C $chan]} {
if {[channel get $chan "cup"]} {
putserv "PRIVMSG $chan :Error: Cup is already running."
} elseif {![channel get $chan "cup"]} {
set cup(slots,$chan) [lindex [split $text] 1]
set cup(type,$chan) [lindex [split $text] 0]
set cup(prize,$chan) [join [lrange [split $text] 2 end]]
if {($cup(type,$chan) != "5on5") && ($cup(type,$chan) != "4on4") && ($cup(type,$chan) != "3on3") && ($cup(type,$chan) != "2on2") && ($cup(type,$chan) != "1on1") && ($cup(type,$chan) == "")} {
putserv "NOTICE $nick :Error: Please enter a correct cup type. ( 5on5 or 4on4 or 3on3 or 2on2 or 1on1 )"
} elseif {($cup(slots,$chan) != "4") && ($cup(slots,$chan) != "8") && ($cup(slots,$chan) != "16") && ($cup(slots,$chan) != "32") && ($cup(slots,$chan) == "")} {
putserv "NOTICE $nick :Error: Please enter a correct slot entry. ( 4 or 8 or 16 or 32 )"
} elseif {($cup(prize,$chan) == "")} {
putserv "NOTICE $nick Error: Please enter a prize. ( prize can be anything )"
} else {
channel set $chan +cup
channel set $chan s_cup_slots $cup(slots,$chan)
channel set $chan s_cup_type $cup(type,$chan)
channel set $chan s_cup_prize $cup(prize,$chan)
channel set $chan s_cup_teams 0
channel set $chan s_cup_admin $nick
channel set $chan s_cup_HLTV None set
channel set $chan s_cup_maps de_dust2
putserv "PRIVMSG $chan :The $chan [channel get $chan "s_cup_type"] is now on with [channel get $chan "s_cup_slots"] slots."
putserv "PRIVMSG $chan :Your admin is [channel get $chan "s_cup_admin"] and the map is [channel get $chan "s_cup_maps"]."
putserv "PRIVMSG $chan :Bot by #cupcentrum join to request your bot."
} else {
putserv "NOTICE $nick :Error: you do not have access to this command."
}
}
}
}