You could use:

Code:
if ($ialchan(nick!user@host,$chan,1)) { code }

If the nick!user@host (which allows wildcards) is present on the channel the if-statement will be true, otherwise it will be false.