- switch (getConfig('bonus_mode'))
- {
- case 'JACKPOT': // ... jackpot
- if ((SUB_JACKPOT($points) == -1) && (getConfig('bonus_uid') > 0)) {
- // Check points amount first...
- $total = GET_TOTAL_DATA(getConfig('bonus_uid'), "user_points", "points") - GET_TOTAL_DATA(getConfig('bonus_uid'), "user_data", "used_points");
+ switch (getConfig('bonus_mode')) {
+ case 'JACKPOT': // ... jackpot
+ if ((isExtensionActive('jackpot')) && (subtractPointsFromJackpot($points) == -1) && (getConfig('bonus_userid') > 0)) {
+ // Check points amount first...
+ $total = countSumTotalData(getConfig('bonus_userid'), 'user_points', 'points') - countSumTotalData(getConfig('bonus_userid'), 'user_data', 'used_points');
+ if ($total >= $points) {
+ // Subtract points from userid's account
+ subtractPoints('bonus_payout_jackpot', getConfig('bonus_userid'), $points);
+ } // END - if
+ } // END - if
+ break;
+
+ case 'UID': // ... userid's account
+ // Check his amount first
+ $total = countSumTotalData(getConfig('bonus_userid'), 'user_points', 'points') - countSumTotalData(getConfig('bonus_userid'), 'user_data', 'used_points');