PHP Code:
// #########################
$sub = 'Lottery Winner!';
$message = "Hi, $lottery[username]
You've won '$lotteryinfo[lotteryname]' lottery!
$lottery[prize] $vboptions[rpg_currency] has been added to your pocket!";
// ##########################
process_rpg_pm($lotteryinfo['userid'], $lotteryinfo['username'], $bbuserinfo['userid'], $bbuserinfo['username'], $sub, $message);
$DB_site->query("UPDATE " . TABLE_PREFIX . "user SET $vboptions[rpg_pointfield] = $vboptions[rpg_pointfield] + $lotteryinfo[prize] WHERE userid=$lotteryinfo[userid]");
$DB_site->query("DELETE FROM " . TABLE_PREFIX . "rpg_lottery WHERE lotteryid = '$lotteryinfo[lotteryid]'");
$DB_site->query("DELETE FROM " . TABLE_PREFIX . "rpg_lottery_tickets WHERE lotteryid = '$lotteryinfo[lotteryid]'");
Try using this code instead of the similar to above existing code then.