if {[foo]} {
# bla
} else {
# bli
} else {
# blo
}
is wrong, it's either if-else, if-elseif or if-elseif-else (and you can specify as much elseifs as you want).
Try to fix these out, and let's see what happens then.
oki. I did fixed the script. I didnt delete all the if {[$bla != "bla"]} because i thought if i delete it, people could type 1/2/3/4/5 instaed of 5on5 or 3on3 etc and then the script will be useless. Oh well. Heres the new script. Can you check i have done what you said correct Sir_Fz please.
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."
}
} else {
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 )"
} else {
if {($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 )"
} else {
if {($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 {
if {![matchattr $hand |C $chan]} {
putserv "NOTICE $nick :Error: you do not have access to this command."
}
}
}
}
}
}
My god, Are you still too stupid to test your own scripts?
And, Use the [censored] edit button. There is no need to see all these posts from you when it was you who made the last reply anyway.
Test your OWN scripts, FIND out if there is something wrong.
THEN if you absolutely can't fix it ask us what the problem could be and ALWAYS include the error message.
Don't simply go around asking us if every brace you add is correct. There is also no need to make so much posts all containing the same code that is just slightly altered, Try the edit button for once.