If you have a usergroupid and you want to check it, you could do this:
Code:
if (in_array($usergroupid, array(1, 2, 3, 4)))
{
// do redirect
}
Or to check the current user you could do this:
Code:
if (is_member_of($vbulletin->userinfo, 1, 2, 3, 4))
{
// do redirect
}
Of course you could also use !is_member_of and only list the usergorups that should have access, if that's easier.