Fagnerboff
New Member
- Joined
- Oct 10, 2010
- Messages
- 48
- Reaction score
- 0
I am with that problem add premium and no vip in modern aac.
I have this script that works in gesior acc.
I tried to modify it for modern aac, because the script iPACC-1.2 is based on gesior acc.
I'd have to put this script of gesior acc.
\/
In this part of confirmtransaction.php
\/
I tried to replace and stayed that way the script.
\/
But the script did not work
See how this the vip_time and lastday in the database before I buy in the shop.
\/
I bought 12 days vip_time in shop with the edited script and was as follows in the database.
\/
The script added the 1036800 seconds equivalent to 12 days of vip_time
The script not added the lastday along with the vip_time.
If the script was working correctly would add 1289889185 seconds which is equivalent to lastday and vip_time together.
Would somebody could help fix the script?
I thank you.
I have this script that works in gesior acc.
I tried to modify it for modern aac, because the script iPACC-1.2 is based on gesior acc.
I'd have to put this script of gesior acc.
\/
PHP:
if($buy_offer['type'] == 'pacc') {
$player_vip_time = $buy_player_account->getCustomField('vip_time');
$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);
if($player_vip_time > 0)
$buy_player_account->setCustomField('vip_time', $player_vip_time + $buy_offer['days'] * 86400);
else
$buy_player_account->setCustomField('vip_time', time() + $buy_offer['days'] * 86400);
$buy_player_account->setCustomField('premium_points', $user_premium_points-$buy_offer['points']);
$user_premium_points = $user_premium_points - $buy_offer['points'];
if ($player_vip_days >= 1) {
}
$main_content .= '<center><h2>VIP Days added!</h2><b>'.$buy_offer['days'].' days</b> of VIP days 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>';
}
In this part of confirmtransaction.php
\/
PHP:
if($buy_offer['offer_type'] == 'pacc')
{
$player_premdays = $buy_account['premdays']; //$buy_player_account- >getCustomField('premdays');
$player_lastlogin = $buy_account['lastday']; //$buy_player_account->getCustomField('lastday');
$save_transaction = 'INSERT INTO z_shop_history_pacc (id, to_name, to_account, from_nick, from_account, price, pacc_days, trans_state, trans_start, trans_real) VALUES (NULL, \''.$buy_player["name"].'\', \''.$buy_account["id"].'\', \''.$buy_from.'\', \''.$loggedAccId.'\', \''.$buy_offer['points'].'\', \''.$buy_offer['count1'].'\', \'realized\', \''.time().'\', \''.time().'\');';
$SQL->query($save_transaction);
$newPremDays=$player_premdays + $buy_offer['count1'];
$premiumPoints = $premiumPoints - $buy_offer['points'];
$SQL->query("UPDATE accounts SET premdays='".$newPremDays."', premium_points='".$premiumPoints."' WHERE name='".$buy_player_account."';");
if($player_premdays == 0)
{
$buy_player_account->setCustomField('lastday', time());
}
echo '<h2>PACC added!</h2><b>'.$buy_offer['count1'].' days</b> of Premium Account have been added to the account of <b>'.$buy_player["name"].'</b>.<br /> <b>'.$buy_offer['points'].' premium points</b> have been deducted from your account.<br />You now have <b>'.$premiumPoints.' premium points</b>.<br /><a href="/index.php/p/v/shop">GO TO MAIN SHOP SITE</a>';
}
I tried to replace and stayed that way the script.
\/
PHP:
if($buy_offer['offer_type'] == 'pacc')
{
$player_vip_time = $buy_account['vip_time']; //$buy_player_account->getCustomField('vip_time');
$player_lastlogin = $buy_account['lastday']; //$buy_player_account->getCustomField('lastday');
$save_transaction = 'INSERT INTO z_shop_history_pacc (id, to_name, to_account, from_nick, from_account, price, pacc_days, trans_state, trans_start, trans_real) VALUES (NULL, \''.$buy_player["name"].'\', \''.$buy_account["id"].'\', \''.$buy_from.'\', \''.$loggedAccId.'\', \''.$buy_offer['points'].'\', \''.$buy_offer['count1'].'\', \'realized\', \''.time().'\', \''.time().'\');';
$SQL->query($save_transaction);
$newvip_time=$player_vip_time + $buy_offer['count1']* 86400;
$premiumPoints = $premiumPoints - $buy_offer['points'];
$SQL->query("UPDATE accounts SET vip_time='".$newvip_time."', premium_points='".$premiumPoints."' WHERE name='".$buy_player_account."';");
if($player_vip_time == 0)
{
$buy_player_account->setCustomField('vip_time', time()* 86400);
}
echo '<h2>PACC added!</h2><b>'.$buy_offer['count1'].' days</b> of Premium Account have been added to the account of <b>'.$buy_player["name"].'</b>.<br /> <b>'.$buy_offer['points'].' premium points</b> have been deducted from your account.<br />You now have <b>'.$premiumPoints.' premium points</b>.<br /><a href="/index.php/p/v/shop">GO TO MAIN SHOP SITE</a>';
}
But the script did not work
See how this the vip_time and lastday in the database before I buy in the shop.
\/
I bought 12 days vip_time in shop with the edited script and was as follows in the database.
\/
The script added the 1036800 seconds equivalent to 12 days of vip_time
The script not added the lastday along with the vip_time.
If the script was working correctly would add 1289889185 seconds which is equivalent to lastday and vip_time together.
Would somebody could help fix the script?
I thank you.
Last edited: