• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Windows Gesior VIPSystem

Natan Beckman

Well-Known Member
Joined
Aug 1, 2010
Messages
548
Reaction score
54
Location
Teresina-PI/Br
My shopsystem.php offer premedays, i want sell vip_time.
how i can change it?

PHP:
                                        if($buy_offer['type'] == 'pacc') {
                                            $player_premdays = $buy_player_account->getCustomField('premdays');
                                            $player_lastlogin = $buy_player_account->getCustomField('lastday');
                                            $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_pacc').' (id, to_name, to_account, from_nick, from_account, price, pacc_days, trans_state, trans_start, trans_real) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).',  '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['days']).', \'realized\', '.$SQL->quote(time()).', '.$SQL->quote(time()).');';
                                            $SQL->query($save_transaction);
                                            $buy_player_account->setCustomField('premdays', $player_premdays+$buy_offer['days']);
                                            $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
                                            $user_premium_points = $user_premium_points - $buy_offer['points'];
                                            if($player_premdays == 0) {
                                                $buy_player_account->setCustomField('lastday', time());
                                            }
                                            $main_content .= '<center><h2>Premium ACcount added!</h2><b>'.$buy_offer['days'].' days</b> of Premium Account added to the account of player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br><br><a href="index.php?subtopic=shopsystem">Go to Shop Site</a><br>';
                                            }
 
Last edited:
go to shopsystem.php and replace:
premdays to vip_days,
lastday to vip_time.

go to line ~421:
PHP:
$buy_player_account->setCustomField('vip_time', time());

replace with:
PHP:
                        $buy_player_account->setCustomField('vip_time', '86400' * $buy_offer['days'] + time());
                        $buy_player_account->setCustomField('vip', '1');
                         }
                        elseif ($player_vip_days >= 1) {
                        $buy_player_account->setCustomField('vip_time', $player_lastlogin +('86400' * $buy_offer['days']));
                        }
 
Error:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'vip_days' in 'field list'' in C:\xampp\htdocs\pot\OTS_Account.php:772 Stack trace: #0 C:\xampp\htdocs\pot\OTS_Account.php(772): PDO->query('SELECT `vip_day...') #1 C:\xampp\htdocs\shopsystem.php(394): OTS_Account->getCustomField('vip_days') #2 C:\xampp\htdocs\index.php(207): include('C:\xampp\htdocs...') #3 {main} thrown in C:\xampp\htdocs\pot\OTS_Account.php on line 772


Script by gesior:
PHP:
                                        if($buy_offer['type'] == 'pacc') {
                                            $player_premdays = $buy_player_account->getCustomField('premdays');
                                            $player_lastlogin = $buy_player_account->getCustomField('lastday');
                                            $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_pacc').' (id, to_name, to_account, from_nick, from_account, price, pacc_days, trans_state, trans_start, trans_real) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).',  '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['days']).', \'realized\', '.$SQL->quote(time()).', '.$SQL->quote(time()).');';
                                            $SQL->query($save_transaction);
                                            $buy_player_account->setCustomField('premdays', $player_premdays+$buy_offer['days']);
                                            $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
                                            $user_premium_points = $user_premium_points - $buy_offer['points'];
                                            if($player_premdays == 0) {
                                                $buy_player_account->setCustomField('lastday', time());
                                            }
                                            $main_content .= '<center><h2>Premium ACcount added!</h2><b>'.$buy_offer['days'].' days</b> of Premium Account added to the account of player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br><br><a href="index.php?subtopic=shopsystem">Go to Shop Site</a><br>';
                                            }
 
Back
Top