Note: Most scripts have a channel watch feature built-in.

If not, you can do something along the lines of:

Code:
on *:text:!trigger:*:{
  if ($nick ison #yourchannel) {
    [command to access xdcc]
  }
  else .notice $nick Access Denied.
}


Note that you'll need to edit your xdcc script so that it will not trigger from ON TEXT (which is what it should be set to trigger on), but instead, trigger as an alias.

Example:

If your xdcc script currently triggers like this:

Code:
on *:text:%xdcc.trigger *:*: {
  if ($2 == send) {
    if ($+(%,file,.,$3) != $null) { dcc send $nick $+(%,file,.,$3) }
  }
}


Then, you'd change it to:
Code:
alias XDCC {
  if ($1 == send) {
    if ($+(%,file,.,$2) != $null) { dcc send $nick $+(%,file,.,$2) }
  }
}


Then, in the code I provided above, you'd make add the alias:

Code:
on *:text:!trigger:*:{
  if ($nick ison #yourchannel) {
    XDCC $2-
  }
  else .notice $nick Access Denied.
}


Note that the !trigger here can be replaced with whatever variable your xdcc script uses as a trigger variable (like the %xdcc.trigger I used in the example xdcc script earlier). Doing so makes it so you never will need to edit that trigger if you change the trigger later.

If you want, you can also ignore the user when you respond with the Access denied notice.