bind msg - !invite invite

proc invite {nick host hand arg} {
sql selectdb pre
set word [lindex [split $arg] 0]
set pass [lindex [split $arg] 1]
set user [join [sql "SELECT user,pass FROM logins WHERE pass='$pass'"]]
if {![botisop #pre]} {
	putquick "PRIVMSG $nick :Iam not opped in #pre"
	return
	}
if {[string equal "" $pass]} {
	putquick "PRIVMSG $nick :4\[ERROR4\] Did not receive a pass"
	return
	}
if {[string equal [lindex $user 0] $word] && [string equal [lindex $user 1] $pass]} {	
	putquick "PRIVMSG #headoffice :4\[INVITE4\] $word was invited by the nick: $nick"
	putquick "INVITE $nick #pre"
	} else {
	putquick "PRIVMSG $nick :4\[ERROR4\] LOGIN/PASS FAILED"
	return
	}
}