That is not how your code is working. You need to put the bottom inside the if statement. I can post the code when I get home if someone doesn't beat to it
--------------- Added [DATE]1450838239[/DATE] at [TIME]1450838239[/TIME] ---------------
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']
);
}