Ir para conteúdo

Featured Replies

Postado

Você quem manda meu chefe!

First Line

elseif($action == 'select_player') {
		unset($_SESSION['viewed_confirmation_page']);
		if(!$logged) {
			$main_content .= 'Please login first.';
		} else {
			$buy_id = (int) $_REQUEST['buy_id'];
			if(empty($buy_id)) {
				$main_content .= 'Please <a href="index.php?subtopic=shopguild">select item</a> first.';
			} else {
				$buy_offer = getItemByID($buy_id);
				if(isset($buy_offer['id'])) {  //item exist in database
					if($buy_offer['type'] != 'changename') {
						if($user_guild_points >= $buy_offer['points']) {
							$main_content .= '<center><h2>Select player</h2><table border="0" cellpadding="1" cellspacing="1" width="650">
								<tr bgcolor="#505050"><td colspan="2"><font color="white" size="4"><b>Selected offer</b></font></td></tr>
								<tr bgcolor="#F1E0C6"><td width="100"><b>Name:</b></td><td width="550">'.$buy_offer['name'].'</td></tr>
								<tr bgcolor="#D4C0A1"><td width="100"><b>Description:</b></td><td width="550">'.$buy_offer['description'].'</td></tr>
								</table><br /><form action="index.php?subtopic=shopguild&action=confirm_transaction" method=POST><input type="hidden" name="buy_id" value="'.$buy_id.'">
								<table border="0" cellpadding="1" cellspacing="1" width="650">
								<tr bgcolor="#505050"><td colspan="2"><font color="white" size="4"><b>Give item to a player from your account</b></font></td></tr>
								<tr bgcolor="#F1E0C6"><td width="110"><b>Name:</b></td><td width="550"><select name="buy_name">';
								$players_from_logged_acc = $account_logged->getPlayersList();
							if(count($players_from_logged_acc) > 0) {
								$players_from_logged_acc->orderBy('name');
								foreach($players_from_logged_acc as $player)
									$main_content .= '<option>'.$player->getName().'</option>';
							} else {
								$main_content .= 'You don\'t have any character on your account.';
							}
							$main_content .= '</select>&nbsp;<input type="submit" value="Give"></td></tr></table>
								</form><br /><form action="index.php?subtopic=shopguild&action=confirm_transaction" method=POST><input type="hidden" name="buy_id" value="'.$buy_id.'">
								<table border="0" cellpadding="1" cellspacing="1" width="650">

								</table><br /></form>';
						} else {
							$main_content .= 'For this item you need <b>'.$buy_offer['points'].'</b> points.<br>You have only <b>'.$user_guild_points.'</b> guild points. Please <a href="index.php?subtopic=shopguild">select other item</a> or buy guild points.';
						}
					} else {
					$main_content .= '<center><h2>Change Name</h2><form action="index.php?subtopic=shopguild&action=confirm_transaction" method=POST><input type="hidden" name="buy_id" value="'.$buy_id.'">
						<table border="0" cellpadding="1" cellspacing="1" width="650"><tr bgcolor="#505050"><td colspan="2"><font color="white" size="4"><b>Change Name:</b></font></td></tr>
						<tr bgcolor="#D4C0A1"><td width="110"><b>Name:</b></td><td width="550"><select name="buy_name">';
					$players_from_logged_acc = $account_logged->getPlayersList();
						if(count($players_from_logged_acc) > 0) {
							$players_from_logged_acc->orderBy('name');
							foreach($players_from_logged_acc as $player) {
								$main_content .= '<option>'.$player->getName().'</option>';
							}
						} else {
							$main_content .= 'You don\'t have any character on your account.';
						}
						$main_content .= '</select></td></tr><tr bgcolor="#F1E0C6"><td width="110"><b>New name:</b></td><td width="550"><input type="text" name="buy_from">&nbsp;<input type="submit" value="Change Name"></td></tr></table><br /></form>';
					}
				} else {
          				$main_content .= 'Offer with ID <b>'.$buy_id.'</b> doesn\'t exist. Please <a href="index.php?subtopic=shopguild">select item</a> again.';
				}
			}
		}
	}

Editado por TioSlash (veja o histórico de edições)

  • Respostas 59
  • Visualizações 16.6k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • luanluciano93
    luanluciano93

    Onde ta new OTS_Player troque por new Player ...   Onde ta:  $check_name_in_database = $ots->createObject('Player'); $check_name_in_database->find($buy_from);   Por: $buy_player = new Playe

  • luanluciano93
    luanluciano93

    muito bom

  • luanluciano93
    luanluciano93

    Espero que dê certo ...  Substitua corretamente, ou senão terá erros!

Posted Images

Postado

Espero que dê certo ... 

elseif($action == 'select_player') 
{
	unset($_SESSION['viewed_confirmation_page']);
	
	if(!$logged) 
	{
		$main_content .= 'Please login first.';
	} 
	else 
	{
		$buy_id = (int) $_REQUEST['buy_id'];
		
		if(empty($buy_id)) 
		{			
			$main_content .= 'Please <a href="index.php?subtopic=shopguild">select item</a> first.';
		} 
		else 
		{
			$buy_offer = getItemByID($buy_id);
			
			if(isset($buy_offer['id'])) 
			{
				if($user_guild_points >= $buy_offer['points']) 
				{
					$main_content .= '<center><h2>Select player</h2><table border="0" cellpadding="1" cellspacing="1" width="650">
					<tr bgcolor="#505050"><td colspan="2"><font color="white" size="4"><b>Selected offer</b></font></td></tr>
					<tr bgcolor="#F1E0C6"><td width="100"><b>Name:</b></td><td width="550">'.$buy_offer['name'].'</td></tr>
					<tr bgcolor="#D4C0A1"><td width="100"><b>Description:</b></td><td width="550">'.$buy_offer['description'].'</td></tr>
					</table><br /><form action="index.php?subtopic=shopguild&action=confirm_transaction" method=POST><input type="hidden" name="buy_id" value="'.$buy_id.'">
					<table border="0" cellpadding="1" cellspacing="1" width="650">
					<tr bgcolor="#505050"><td colspan="2"><font color="white" size="4"><b>Give item to a player from your account</b></font></td></tr>
					<tr bgcolor="#F1E0C6"><td width="110"><b>Name:</b></td><td width="550"><select name="buy_name">';
								
					$players_from_logged_acc = $account_logged->getPlayersList();
						
					if(count($players_from_logged_acc) > 0) 
                    {
                        $players_from_logged_acc->addOrder(new SQL_Order('name', SQL_Order::ASC));  
                        foreach($players_from_logged_acc as $player)
						{
							$main_content .= '<option>'.$player->getName().'</option>';
						}
                    } 
					else 
					{
						$main_content .= 'You don\'t have any character on your account.';
					}
					
					$main_content .= '</select>&nbsp;<input type="submit" value="Give"></td></tr></table></form><br />
					<form action="index.php?subtopic=shopguild&action=confirm_transaction" method=POST><input type="hidden" name="buy_id" value="'.$buy_id.'">
					<table border="0" cellpadding="1" cellspacing="1" width="650"> </table><br /></form>';
				} 
				else 
				{
					$main_content .= 'For this item you need <b>'.$buy_offer['points'].'</b> points.<br>You have only <b>'.$user_guild_points.'</b> guild points. Please <a href="index.php?subtopic=shopguild">select other item</a> or buy guild points.';
				}
			} 
			else 
			{
          		$main_content .= 'Offer with ID <b>'.$buy_id.'</b> doesn\'t exist. Please <a href="index.php?subtopic=shopguild">select item</a> again.';
			}
		}
	}
}



Substitua corretamente, ou senão terá erros!

Postado

Esse ai já foi,

agora deu erro em outro:

 

index.php?subtopic=shopguild&action=confirm_transaction

 

segue abaixo a action dele  (igual fiz com o player_select)

 

	elseif($action == 'confirm_transaction') {
		if(!$logged) {
			$main_content .= 'Please login first.';
		} else {
			$buy_id = (int) $_POST['buy_id'];
			$buy_name = stripslashes(urldecode($_POST['buy_name']));
			$buy_from = stripslashes(urldecode($_POST['buy_from']));
			if(empty($buy_id)) {
				$main_content .= 'Please <a href="index.php?subtopic=shopguild">select item</a> first.';
			} else {
				if($buy_offer['type'] == 'changename'){
					if(!check_name_new_char($buy_from)) {
						$main_content .= 'Invalid name format of new name.';
					}
				} else {
					$buy_offer = getItemByID($buy_id);
					$check_name_in_database = $ots->createObject('Player');
					$check_name_in_database->find($buy_from);
					if($buy_offer['type'] == 'changename'){
						if(!$check_name_in_database->isLoaded()) {
						}
					}
					if(isset($buy_offer['id'])) {  //item exist in database
						if($user_guild_points >= $buy_offer['points']) {
							if(check_name($buy_name)) {
								$buy_player = new OTS_Player();
								$buy_player->find($buy_name);
								if($buy_player->isLoaded()) {
									$buy_player_account = $buy_player->getAccount();
									if($_SESSION['viewed_confirmation_page'] == 'yes' && $_POST['buy_confirmed'] == 'yes') {
										
										
										
			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_shopguild_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('guild_points', $user_guild_points-$buy_offer['points']);
				$user_guild_points = $user_guild_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'].' guild points</b> from your account.<br />Now you have <b>'.$user_guild_points.' guild points</b>.<br><br><a href="index.php?subtopic=shopguild">Go to Shop Site</a><br>';
				}
			elseif($buy_offer['type'] == 'unban') {
				$my_acc_id = $account_logged->getCustomField('id');
				$datadata = $SQL->query('SELECT * FROM '.$SQL->tableName('bans').' WHERE value = '.$my_acc_id.';')->fetch();
					if($datadata['value'] == $my_acc_id) {
						if($SQL->query('DELETE FROM bans WHERE value= '.$my_acc_id.' LIMIT 1;')) {
						} else {
							$SQL->query('DELETE FROM bans WHERE account= '.$my_acc_id.' LIMIT 1;');
						}
						$account_logged->setCustomField('guild_points', $user_guild_points-$buy_offer['points']);
						$user_guild_points = $user_guild_points - $buy_offer['points'];
						$main_content .= '<center><h2>Ban Deleted!</h2><b>Your account has been unbanned for '.$buy_offer['points'].' guild points</b> from your account.
							<br>Now you have <b>'.$user_guild_points.' guild points</b>.<br><br><a href="index.php?subtopic=shopguild">Go to Shop Site</a><br>';
					} else {
						$main_content .= '<center><b>You don\'t have any bans in your account!</b><br><br><a href="index.php?subtopic=shopguild">Go back</a><br>';
					}
				}
										////////////////////////////////
										elseif($buy_offer['type'] == 'itemlogout') {
											$my_acc_id = $buy_player->getCustomField('id');
											$playerinfo = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE id = '.$my_acc_id.';')->fetch();
											$playerslot = $SQL->query('SELECT * FROM '.$SQL->tableName('player_items').' WHERE player_id = '.$my_acc_id.';')->fetch();
											if($playerinfo['online'] == '0') {
												if ($playerslot['pid'] != '10') {
													if ($datadata['cap'] >= $SQL->quote($buy_offer['free_cap'])) {
														$SQL->query('INSERT INTO player_items (player_id, pid, itemtype, count) VALUES ('.$my_acc_id.', '.$SQL->quote($buy_offer['pid']).', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['count1']).');');
														$account_logged->setCustomField('guild_points', $user_guild_points-$buy_offer['points']);
														$user_guild_points = $user_guild_points - $buy_offer['points'];
														$main_content .= '<h2>Item received to player: '.$buy_player->getName().'!</h2><br>Now you have <b>'.$user_guild_points.' guild points</b>.
															<br><a href="index.php?subtopic=shopguild">Go to Shop Site</a>';
													} else {
														$main_content .= '<b>You need '.$SQL->quote($buy_offer['free_cap']).' or more of cap!</b><br><a href="index.php?subtopic=shopguild">Go back</a>';
													}
												} else {
													$main_content .= '<b>Please leave the arrow slot in blank to receive item!</b><br><a href="index.php?subtopic=shopguild">Go back</a>';
												}
											} else {
												$main_content .= '<b>You need to be offline!</b><br><a href="index.php?subtopic=shopguild">Go back</a>';
											}
										}
										////////////////////////////////
										elseif($buy_offer['type'] == 'changename') {
										$erroName=0;
										if(!check_name_new_char($buy_from)) {
											$main_content .= 'Invalid name format of new name.';
											$erroName++;
										}
										
											$my_acc_id = $buy_player->getCustomField('id');
											$playerinfo = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE '.$SQL->fieldName('id').' = '.$my_acc_id.';')->fetch();
											$checkname = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE '.$SQL->fieldName('name').' = '. $SQL->quote($buy_from) .';')->fetch();
 											if($playerinfo['online'] == '0') {
												
												if($checkname == false and $erroName == 0) { 
													$SQL->query('UPDATE `players` SET `name` = '. $SQL->quote($buy_from) .' WHERE `id` = '. $my_acc_id.' ;');
													$account_logged->setCustomField('guild_points', $user_guild_points-$buy_offer['points']);
													$user_guild_points = $user_guild_points - $buy_offer['points'];
													$main_content .= '<center><h2>Your name has been changed to '.$buy_from.'.</h2><br><b>You have '.$user_guild_points.' guild points left</b>.
														<br><br><a href="index.php?subtopic=shopguild">Go to Shop Site</a><br>';
												} else {
													$main_content .= '<center><h2>Sorry, the name "<i>'.$buy_from.'</i>" does already exist.<br>Please select another name.</h2><br>';
												}
											} else {
												$main_content .= '<center><h2>'.$buy_name.' has to be offline to complete transaction.</h2><br><br><a href="index.php?subtopic=shopguild">Go back</a><br>';
											}
										}
										////////////////////////////////
										elseif($buy_offer['type'] == 'redskull') {
											$my_acc_id = $buy_player->getCustomField('id');
											$playerinfo = $SQL->query('SELECT * FROM '.$SQL->tableName('players').' WHERE '.$SQL->fieldName('id').' = '.$my_acc_id.';')->fetch();
											if($playerinfo['skull'] == '4' AND $playerinfo['online'] >= '0' AND $playerinfo['skulltime'] > '0') {
												$SQL->query('UPDATE killers SET unjustified=0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id='. $my_acc_id .');');
												$SQL->query('UPDATE players SET skulltime=0, skull=0 WHERE id='. $my_acc_id .';');
												$account_logged->setCustomField('guild_points', $user_guild_points-$buy_offer['points']);
												$user_guild_points = $user_guild_points - $buy_offer['points'];
												$main_content .= '<center><h2>RedSkull Removed!</h2><br><b>Your redskull has been removed from the player '.$buy_player->getName().'.</b>
													<br>Now you have<b> '.$user_guild_points.' guild points</b>.<br><br><a href="index.php?subtopic=shopguild">Go to Shop Site</a><br>';
											} else {
												$main_content .= '<center><b>'.$buy_player->getName().' has to be offline or have redskull to complete transaction!.</b><br><br><a href="index.php?subtopic=shopguild">Go back</a><br>';
											}
										}
										//////////////////////////
										elseif($buy_offer['type'] == 'item') {
											$sql = 'INSERT INTO '.$SQL->tableName('z_ots_comunication').' (id, name, type, action, param1, param2, param3, param4, param5, param6, param7, delete_it) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', \'login\', \'give_item\', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['item_count']).', \'\', \'\', \'item\', '.$SQL->quote($buy_offer['name']).', \'\', \'1\');';
											$SQL->query($sql);
											$save_transaction = 'INSERT INTO '.$SQL->tableName('z_shopguild_history_item').' (id, to_name, to_account, from_nick, from_account, price, offer_id, trans_state, trans_start, trans_real) VALUES ('.$SQL->lastInsertId().', '.$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['item_id']).', \'wait\', '.$SQL->quote(time()).', \'0\');';
											$SQL->query($save_transaction);
											$account_logged->setCustomField('guild_points', $user_guild_points-$buy_offer['points']);
											$user_guild_points = $user_guild_points - $buy_offer['points'];
											$main_content .= '<center><h2>Item added!</h2><b>'.$buy_offer['name'].'</b> added to player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' guild points</b> from your account.<br>Now you have <b>'.$user_guild_points.' guild points</b>.<br><br><a href="index.php?subtopic=shopguild">GO TO MAIN SHOP SITE</a><br>';
										}
                                                                                if($buy_offer['type'] == 'vipdays') {
											$player_vip_time = $buy_player_account->getCustomField('vip_time');
											$player_lastlogin = $buy_player_account->getCustomField('lastday');
											$save_transaction = 'INSERT INTO '.$SQL->tableName('z_shopguild_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);
											$account_logged->setCustomField('guild_points', $user_guild_points-$buy_offer['points']);
											$user_guild_points = $user_guild_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'].' guild points</b> from your account.<br />Now you have <b>'.$user_guild_points.' guild points</b>.<br><br><a href="index.php?subtopic=shopguild">Go to Shop Site</a><br>';
										}  
										elseif($buy_offer['type'] == 'megaitems') {
											$sql = 'INSERT INTO '.$SQL->tableName('z_ots_comunication').' (id, name, type, action, param1, param2, param3, param4, param5, param6, param7, delete_it) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', \'login\', \'give_item\', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['megaitems_count']).', \'\', \'\', \'megaitems\', '.$SQL->quote($buy_offer['name']).', \'\', \'1\');';
											$SQL->query($sql);
											$save_transaction = 'INSERT INTO '.$SQL->tableName('z_shopguild_history_item').' (id, to_name, to_account, from_nick, from_account, price, offer_id, trans_state, trans_start, trans_real) VALUES ('.$SQL->lastInsertId().', '.$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['item_id']).', \'wait\', '.$SQL->quote(time()).', \'0\');';
											$SQL->query($save_transaction);
											$account_logged->setCustomField('guild_points', $user_guild_points-$buy_offer['points']);
											$user_guild_points = $user_guild_points - $buy_offer['points'];
											$main_content .= '<center><h2>Mega Item added!</h2><b>'.$buy_offer['name'].'</b> added to player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' guild points</b> from your account.<br>Now you have <b>'.$user_guild_points.' guild points</b>.<br><br><a href="index.php?subtopic=shopguild">GO TO MAIN SHOP SITE</a><br>';
										}
										elseif($buy_offer['type'] == 'container') {
											$sql = 'INSERT INTO '.$SQL->tableName('z_ots_comunication').' (id, name, type, action, param1, param2, param3, param4, param5, param6, param7, delete_it) VALUES (NULL, '.$SQL->quote($buy_player->getName()).', \'login\', \'give_item\', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['item_count']).', '.$SQL->quote($buy_offer['container_id']).', '.$SQL->quote($buy_offer['container_count']).', \'container\', '.$SQL->quote($buy_offer['name']).', \'\', \'1\');';
											$SQL->query($sql);
											$save_transaction = 'INSERT INTO '.$SQL->tableName('z_shopguild_history_item').' (id, to_name, to_account, from_nick, from_account, price, offer_id, trans_state, trans_start, trans_real) VALUES ('.$SQL->lastInsertId().', '.$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['item_id']).', \'wait\', '.$SQL->quote(time()).', \'0\');';
											$SQL->query($save_transaction);
											$account_logged->setCustomField('guild_points', $user_guild_points-$buy_offer['points']);
											$user_guild_points = $user_guild_points - $buy_offer['points'];
											$main_content .= '<center><h2>Container of items added!</h2><b>'.$buy_offer['name'].'</b> added to player <b>'.$buy_player->getName().'</b> for <b>'.$buy_offer['points'].' guild points</b> from your account.<br />Now you have <b>'.$user_guild_points.' guild points</b>.<br><br><a href="index.php?subtopic=shopguild">GO TO MAIN SHOP SITE</a><br>';
										}
									} else {
										if($buy_offer['type'] != 'changename') {
											$set_session = TRUE;
											$_SESSION['viewed_confirmation_page'] = 'yes';
											$main_content .= '<center><h2>Confirm transaction</h2>
												<table border="0" cellpadding="1" cellspacing="1" width="700">
												<tr bgcolor="#505050"><td colspan="3"><font color="white" size="4"><b>Confirm transaction</b></font></td></tr>
												<tr bgcolor="#D4C0A1"><td width="100"><b>Name:</b></td><td width="550" colspan="2">'.$buy_offer['name'].'</td></tr>
												<tr bgcolor="#F1E0C6"><td width="100"><b>Description:</b></td><td width="550" colspan="2">'.$buy_offer['description'].'</td></tr>
												<tr bgcolor="#D4C0A1"><td width="100"><b>Cost:</b></td><td width="550" colspan="2"><b>'.$buy_offer['points'].' guild points</b> from your account</td></tr>
												<tr bgcolor="#F1E0C6"><td width="100"><b>For Player:</b></td><td width="550" colspan="2"><font color="red">'.$buy_player->getName().'</font></td></tr>
												<tr bgcolor="#D4C0A1"><td width="100"><b>From:</b></td><td width="550" colspan="2"><font color="red">'.$buy_from.'</font></td></tr>
												<tr bgcolor="#F1E0C6"><td width="100"><b>Transaction?</b></td><td width="275" align="left">
												<form action="index.php?subtopic=shopguild&action=confirm_transaction" method="POST"><input type="hidden" name="buy_confirmed" value="yes"><input type="hidden" name="buy_id" value="'.$buy_id.'"><input type="hidden" name="buy_from" value="'.urlencode($new_name).'"><input type="hidden" name="buy_name" value="'.urlencode($buy_name).'"><input type="submit" value="Accept"></form></td>
												<td align="right"><form action="index.php?subtopic=shopguild" method="POST"><input type="submit" value="Cancel"></form></td></tr>
												</table>';
										} else {
											$set_session = TRUE;
											$_SESSION['viewed_confirmation_page'] = 'yes';
											$main_content .= '<center><h2>Confirm Name Changing</h2>
												<table border="0" cellpadding="1" cellspacing="1" width="700">
												<tr bgcolor="#505050"><td colspan="3"><font color="white" size="4"><b>Confirm transaction</b></font></td></tr>
												<tr bgcolor="#D4C0A1"><td width="130"><b>Name:</b></td><td width="550" colspan="2">'.$buy_offer['name'].'</td></tr>
												<tr bgcolor="#F1E0C6"><td width="130"><b>Description:</b></td><td width="550" colspan="2">'.$buy_offer['description'].'</td></tr>
												<tr bgcolor="#D4C0A1"><td width="130"><b>Cost:</b></td><td width="550" colspan="2"><b>'.$buy_offer['points'].' guild points</b> from your account</td></tr>
												<tr bgcolor="#F1E0C6"><td width="130"><b>Current Name:</b></td><td width="550" colspan="2"><font color="red">'.$buy_player->getName().'</font></td></tr>
												<tr bgcolor="#D4C0A1"><td width="130"><b>New Name:</b></td><td width="550" colspan="2"><font color="red">'.$buy_from.'</font></td></tr>
												<tr bgcolor="#F1E0C6"><td width="130"><b>Change Name?</b></td><td width="275" align="left">
												<form action="index.php?subtopic=shopguild&action=confirm_transaction" method="POST"><input type="hidden" name="buy_confirmed" value="yes"><input type="hidden" name="buy_id" value="'.$buy_id.'"><input type="hidden" name="buy_from" value="'.urlencode($buy_from).'"><input type="hidden" name="buy_name" value="'.urlencode($buy_name).'"><input type="submit" value="Accept"></form></td>
												<td align="right"><form action="index.php?subtopic=shopguild" method="POST"><input type="submit" value="Cancel"></form></td></tr>
												</table>';
										}
									}
								} else {
									$main_content .= 'Player with name <b>'.$buy_name.'</b> doesn\'t exist. Please <a href="index.php?subtopic=shopguild&action=select_player&buy_id='.$buy_id.'">select other name</a>.';
								}
							} else {
								$main_content .= 'Invalid name format. Please <a href="index.php?subtopic=shopguild&action=select_player&buy_id='.$buy_id.'">select other name</a> or contact with administrator.';
							}
						} else {
							$main_content .= 'For this item you need <b>'.$buy_offer['points'].'</b> points. You have only <b>'.$user_guild_points.'</b> guild points. Please <a href="index.php?subtopic=shopguild">select other item</a> or buy guild points.';
						}
          				} else {
						$main_content .= 'Offer with ID <b>'.$buy_id.'</b> doesn\'t exist. Please <a href="index.php?subtopic=shopguild">select item</a> again.';
					}
				}
			}
		}
		if(!$set_session) {
			unset($_SESSION['viewed_confirmation_page']);
		}
	}

Se puder me ajudar ai vou sempre grato,

e se caso houver algo em que EU possa lhe ajudar me diga!

Que faço de tudo pra isso ;)

Postado

Onde ta new OTS_Player troque por new Player ...

 

Onde ta: 

$check_name_in_database = $ots->createObject('Player');
$check_name_in_database->find($buy_from);

 

Por:

$buy_player = new Player();
$buy_player->find($buy_from);

Acho que é isso .. testa ai!
Postado

Funcionou!

deu outro errozinho dizendo que nao existia o a class.ots_player.php ai eu modifiquei a linha

$buy_player = new OTS_Player();
para

$buy_player = new Player();
e deu tudo certo õ/

Valeu amigo!

se precisar de alguma coisa é só pedir!

Você tem muito credito na minha mão xD

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo