MyBB Community Forums

Full Version: Subtracting a user's points in NewPoints
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What variable contains the number of NewPoints a user has, and how would I subtract from this variable and inject it back into the database whenever a user purchases an item from a shopping page? I do not want to bother with a shop plug-in because those do not suit my needs. Thank you! Smile
Support for NewPoints is given here:
http://forums.mybb-plugins.com/index.php

Smile
+1 on your Reputation. I actually think I will be writing my own plug-in for this. Smile
You can use the newpoints_addpoints(); provided within the plugin file:
if($mybb->input['action'] == 'buy')
{
	newpoints_addpoints($mybb->user['uid'], -10);
}
elseif($mybb->input['action'] == 'sell')
{
	newpoints_addpoints($mybb->user['uid'], 10);
}
error('No valid action selected.');