sorry, i think I read what you wanted backwards, try this:
PHP Code:
global $vbulletin, $db, $userinfo;
if ($vbulletin->GPC['points'] == 0) {
$points = $userinfo['ipoints'];
$rep = $userinfo['reputation'];
if ($points > 0)
{
$newrep = ($rep - $points*500);
}
else
{
$newrep = ($rep - 150);
}
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET reputation = " . $newrep . "
WHERE userid = " . $userinfo['userid']
);
}