Quote:
Originally Posted by Chris.08i
That is correct.
The hook I am using is 'infraction_update_complete'
|
ok, in that case the first piece of code I posted should work for what you want, but you say it is not actually subtracting the points. Did you get a SQL error?
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'] .""
);
}