Ir para conteúdo
  • Cadastre-se

Posts Recomendados

  • Respostas 59
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Obrigatoriamente leia tudo! Atualizado 01/07/2014   Opa galera mais uma vez eu trazendo o melhor para todos. Hoje vou postar o sistema de Guild de Points que eu utilizo em meu OTserver, acredito q

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

Ta certo o erro é no layout.php veja que tem: ?subtopic=shopadmin em cima e  em baixo   corrija!

Posted Images

  • 4 weeks later...

Olá Amigo!

Curti muito teu topico.

tentei colocar no meu site mais da o seguinte erro quando clica na SHOP GUILD

 
Error occured!Error ID: ObjectData::getCustomField - Field guild_points does not exist in data / is not loaded.
More info: 

File: C:\UniServer\www\classes/objectdata.php   Line: 52
File: C:\UniServer\www\pages/shopguild.php   Line: 4
File: C:\UniServer\www\system/load.page.php   Line: 7
File: C:\UniServer\www/index.php   Line: 37

Uso TFS 1.0

Link para o post
Compartilhar em outros sites

Amigo vá em classes/account.php ...

nas primeiras linhas tem essas partes:

public $data = array( ...
public static $fields = array(...


Adicione nas 2 o guild_points!

Exemplo: 
public $data = array('guild_points' => null, ...
public static $fields = array('guild_points', ...

 

Caso não funcione me avise!

Link para o post
Compartilhar em outros sites

Essa parte Funcionou,

Só que apareceu outro erro!

Quando eu clico em Guild Shop agora vai normal,

não aparece mais o erro,

só que quando eu seleciono o item pra comprar (tendo os guild points) ele da erro fica uma pagina em branco

a URL que ele vai é a :

index.php?subtopic=shopguild&action=select_player

mais fica toda em branco !

Sabe me ajudar Luan?

Editado por TioSlash (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Vamos fazer uma troca .. eu te ajuda, mas você terá que achar as separações em actions desse arquivo, me mande apenas o action SELECT_PLAYER, do começo ao fim. =)

Estamos aqui para ENSINAR e não fazer de mão beijada, haha

(COLOCA EM SPOILER, POR FAVOR)

Link para o post
Compartilhar em outros sites

Linha 215

$main_content .= '<form action="index.php?subtopic=shopguild&action=select_player" method=POST><input type="hidden" name="buy_id" value="'.$item['id].'"><input type="submit" value="Buy '.$item['name'].'"><br><b>for '.$item['points'].' points</b></form>';

Linha 227

$main_content .= '<form action="index.php?subtopic=shopguild&action=select_player" method=POST><input type="hidden" name="buy_id" value="'.$item['id].'"><input type="submit" value="Buy '.$item['name'].'"><br><b>for '.$item['points'].' points</b></form>';

Linha 239

$main_content .= '<form action="index.php?subtopic=shopguild&action=select_player" method=POST><input type="hidden" name="buy_id" value="'.$item['id].'"><input type="submit" value="Buy '.$item['name'].'"><br><b>for '.$item['points'].' points</b></form>';

Linha 250

$main_content .= '<form action="?subtopic=shopguild&action=select_player" method=POST><input type="hidden" name="buy_id" value="'.$container['id].'"><input type="submit" value="Buy '.$container['name'].'"><br><b>for '.$container['points'].' points</b></form>';

Linha 260

$main_content .= '<form action="index.php?subtopic=shopguild&action=select_player" method=POST><input type="hidden" name="buy_id" value="'.$itemlogout['id].'"><input type="submit" value="Buy '.$itemlogout['name'].'"><br><b>for '.$itemlogout['points'].' points</b></form>';

Linha 272

$main_content .= '<form action="index.php?subtopic=shopguild&action=select_player" method=POST><input type="hidden" name="buy_id" value="'.$pacc['id].'"><input type="submit" value="Buy '.$pacc['name'].'"><br><b>for '.$pacc['points'].' points</b></form>';

Linha 279

$main_content .= '<form action="index.php?subtopic=shopguild&action=select_player" method=POST><input type="hidden" name="buy_id" value="'.$changename['id].'"><input type="submit" value="Buy '.$changename['name'].'"><br><b>for '.$changename['points'].' points</b></form>';

Linha 286

$main_content .= '<form action="index.php?subtopic=shopguild&action=select_player" method=POST><input type="hidden" name="buy_id" value="'.$redskull['id].'"><input type="submit" value="Buy '.$redskull['name'].'"><br><b>for '.$redskull['points'].' points</b></form>';

Linha 294

$main_content .= '<form action="index.php?subtopic=shopguild&action=select_player" method=POST><input type="hidden" name="buy_id" value="'.$unban['id].'"><input type="submit" value="Buy '.$unban['name'].'"><br><b>for '.$unban['points'].' points</b></form>';

Linha 562

$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>.';

Linha 565

$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.';

Editado por TioSlash (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

que isso? kk

Tipo no gesior ele abre actions .. exemplo se tem a página shop, ai tu quer criar uma actino para vidaloka, ai se cria assim:

if ($action == 'vidaloka')
{
  echo 'Testando';
}

O que estiver dentro das chaves é a action vidaloka ... 

Eu quero tudo que tiver dentro da action SELECT_PLAYER

Link para o post
Compartilhar em outros sites

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)
Link para o post
Compartilhar em outros sites

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!

Link para o post
Compartilhar em outros sites

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 ;)

Link para o post
Compartilhar em outros sites

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!
Link para o post
Compartilhar em outros sites

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

Link para o post
Compartilhar em outros sites
  • 4 weeks later...

Amigo, eu fiz tudo certo, foi tudo como falou só que aconteceu uma coisa, não deu erro algum, porem o admin guild painel não aparece, oque poderia estar acontecendo isso?

 

agora quando eu clico no shop normal aparece isso.

 

Sorry, you have not the rights to access this page.

Editado por lucasmuniz67 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Achei, o erro foi meu mesmo, mais estou com outro problema, o shop vip ta normal, agora o shop guild ta meio estranho, não está aparecendo o Painel de guild points admin, somente o shop vip.

 

http://tinypic.com/r/33u6anq/8

 

estou sempre logado na conta do god.

Editado por lucasmuniz67 (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Achei, o erro foi meu mesmo, mais estou com outro problema, o shop vip ta normal, agora o shop guild ta meio estranho, não está aparecendo o Painel de guild points admin, somente o shop vip.

 

http://tinypic.com/r/33u6anq/8

 

estou sempre logado na conta do god.

Posta o seu layouts.php ai mano pra mim corrigir, observei outro erro!

 

Adiciona isso em config.php

$config['site']['shopguild_system'] = 1;
$config['site']['access_adminguild_panel'] = 9;
Editado por Natanael Beckman (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por Born Retarded
      É possível fazer um sistema(script) que ao criar uma guild , o jogador fique com um prefixo antes do nome ? 


      Exemplo: Aqueles sistemas de VIP onde o jogador fica com o nome [VIP] Nome.


      Se possível determinar na script/comando de criar guild, um número de caracteres máximo pra ficar como Tag da guild.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo