Ir para conteúdo

Featured Replies

Postado

.Qual servidor ou website você utiliza como base? 

Modern Aac TFS 0,4

Qual o motivo deste tópico? 

Gostaria de saber se é possivel alguem adicionar outfit a este signature, eu tentei mas não consegui, vi q o comand getLooktype funciona, tentei gerar um caminho com base nisso, mas sem sucesso.

Script do Signature 

Citar
Spoiler



<?PHP

	// Exit the script in case GD is not installed on the local webserver.
	if ( !extension_loaded( 'gd' ) || !function_exists( 'imagettfbbox' ) )
	{
		exit( 'Oh, noez! :-( It appears that you do not have the required GD/Freetype extension to use this script...' );
	}

	ob_start( );

	// Define the base path as a constant variable.
	define( 'BASEPATH', '../../..' );
	// Create a second constant variable for the base path (used by Modern AAC).
	define( 'FCPATH', BASEPATH.'/' );
	// Define the injection path as a constant variable.
	define( 'INJECTIONPATH', BASEPATH.dirname( $_SERVER['SCRIPT_NAME'] ) );
	// Define the application path as a constant variable.
	define( 'APPPATH', BASEPATH.'/system/application/' );
	
	// Include the signature configuration file.
	require_once( INJECTIONPATH.'/config.inc.php' );
	// Include the ImageDraw class.
	require_once( INJECTIONPATH.'/system/ImageDraw.class.php' );
	// Include the POT library.
	require_once( APPPATH.'/libraries/POT/OTS.php' );
	// Include the system file.
	require_once( APPPATH.'/libraries/system.php' );
	// Include the configuration file.
	require_once( BASEPATH.'/config.php' );
	
	
	// Get the ID from the URL arguments.
	$ID = ( ( isset( $_GET['id'] ) && ctype_digit( $_GET['id'] ) ) ? $_GET['id'] : 0 );
		
	// Instantiate a new POT object, as well as connect to the database.
	POT::getInstance( )->connect( POT::DB_MYSQL, connection( ) );
	// Create a variable to hold the database handle.
	$database = POT::getInstance( )->getDBHandle( );
	
	// Instantiate a new OTS_PLAYER object and attempt to load the character supplied by the URL arguments..
	$character = new OTS_Player( );
	$character->load( $ID );
	// Return false in case the player was not found.
	if ( !$character->isLoaded( ) )
		die( 'Failed to load player with ID of '.$ID.'.' );
	
	
	// Fetch the player items and the house from the database.
	$info = $database->query( 'SELECT `i`.`pid`, `i`.`itemtype`, `i`.`count`, `h`.`name` AS `house`, `h`.`town` FROM `player_items` AS `i` LEFT JOIN `houses` AS `h` ON `h`.`OWNER` = `i`.`player_id` WHERE `i`.`pid` BETWEEN 1 AND 10 AND `i`.`player_id` = '.( (int) $character->getID( ) ).';' )->fetchAll( );
	// Set the default values for vocations and towns.
	list( $vocation, $town, $houseTown, $world ) = array( 'no vocation', 'an unknown town', 'an unknown town', NULL );
	
	// If a vocation name was found, use that rather than the default value.
	if ( array_key_exists( $character->getVocation( ), $config['server_vocations'] ) )
		$vocation = ( $character->getPromotion( ) != 0 ? $config['promotions'][$character->getVocation( )] : $config['server_vocations'][$character->getVocation( )] );
		
	// If a town name was found, use that rather than the default value.
	if ( array_key_exists( $character->getTownID( ), $config['cities'] ) )
		$town = $config['cities'][$character->getTownID( )];
	
	// If a world name was found, use that rather than the default value.
	if ( array_key_exists( $character->getWorld( ), $config['worlds'] ) )
		$world = $config['worlds'][$character->getWorld( )];
		
	// If a town name was found, use that rather than the default value.
	if ( isset( $info[0]['town'] ) && array_key_exists( $info[0]['town'], $config['cities'] ) )
		$houseTown = $config['cities'][$info[0]['town']];
	
	
	
	
	// Instantiate a new ImageDraw instance.
	$signature = new ImageDraw( TRUE, $injectionSettings['enableCache'] );
	// Make sure the ImageDraw instance is enabled before outputting it.
	if ( $signature->isEnabled( ) )
	{
		// Create a cache object from the ImageDraw instance.
		$cache = $signature->createObject( 'cache' )
						->setTime( $injectionSettings['cacheLength'] ) /* 60 minutes */
						->setDirectory( INJECTIONPATH.'/cache/' )
						->setFile( $character->getID( ) );
		
		// (Re-)create the ImageDraw instance in case it does not exist, or the cache has expired.
		if ( $cache->hasExpired( ) )
		{
			// Create an image object from the ImageDraw instance.
			$image = $signature->createObject( 'image' )
							->applyBackground( $injectionSettings['background'] )
							->applyFont( $injectionSettings['fontDefault'], $injectionSettings['fontSize'], $injectionSettings['colourDefault'] );
			
			// Add the characters name to the image object.
			$image->applyString( $character->getName( ), 10, 25, TRUE, ( $character->isOnline( ) ? $injectionSettings['colourOnline'] : $injectionSettings['colourOffline'] ), INJECTIONPATH.'/system/SeanHand.ttf', 18 )->breakRow( 9 );
			
			// Add the characters sex, level, vocation and world to the image object.
			$image->applyString( ( $character->getSex( ) == 0 ? 'She' : 'He' ).' is a', 10 )->applySpacer( 5 );
			$image->applyString( $vocation, 0, 0, TRUE, $injectionSettings['colourKeywords'] )->applySpacer( 10 );
			$image->applyString( 'level' )->applySpacer( 5 );
			$image->applyString( $character->getLevel( ), 0, 0, TRUE, $injectionSettings['colourKeywords'] )->applySpacer( 5 );
		
			if ( !is_null( $world ) )
			{
				$image->applySpacer( 3 )->applyString( ' in world' )->applySpacer( 5 );
				$image->applyString( $world, 0, 0, TRUE, $injectionSettings['colourKeywords'] )->applySpacer( 2 );
			}
			$image->applySpacer( 3 )->applyString( '.' )->breakRow( 7 );
			
			
			// Add the characters house (if he/she has one) and town to the image object.
			$image->applyString( ( $character->getSex( ) == 0 ? 'She' : 'He' ), 10 )->applySpacer( 5 );
			$image->applyString( 'currently resides in' )->applySpacer( 5 );
			$image->applyString( $town, 0, 0, TRUE, $injectionSettings['colourKeywords'] );
			
			// Fetch the characters house (if he/she has one) from the database.
			if ( isset( $info[0] ) && !is_null( $info[0]['house'] ) )
			{
				$image->applySpacer( 5 )->applyString( 'and owns' )->breakRow( 7 );
				$image->applyString( 'the', 10 )->applySpacer( 5 );
				$image->applyString( $info[0]['house'], 0, 0, TRUE, $injectionSettings['colourKeywords'] )->applySpacer( 5 );
				$image->applyString( 'in '.$houseTown );
			}
			$image->applySpacer( 2 )->applyString( '.' )->breakRow( 7 );
			
			
			// Add the characters guild (if he/she has one) to the image object.
			if ( $character->getRank( ) != NULL )
			{
				$image->applyString( ( $character->getSex( ) == 0 ? 'She' : 'He' ), 10 )->applySpacer( 5 );
				$image->applyString( 'is' )->applySpacer( 5 );
				$image->applyString( $character->getRank( )->getName( ), 0, 0, TRUE, $injectionSettings['colourKeywords'] )->applySpacer( 5 );
				$image->applyString( 'of the' )->applySpacer( 5 );
				$image->applyString( $character->getRank( )->getGuild( )->getName( ), 0, 0, TRUE, $injectionSettings['colourKeywords'] )->applySpacer( 2 );
				$image->applyString( '.' )->breakRow( 7 );
			}
			
			
			// Add the characters latest login and account status to the image object.
			$lastlogin = $character->getLastLogin( ) == 0 ? FALSE : TRUE;
			$image->applyString( ( $character->getSex( ) == 0 ? 'She' : 'He' ), 10 )->applySpacer( 5 );
			if ( $character->isOnline( ) )
			{
				$image->applyString( 'is currently online as a '.( $character->getAccount( )->getPremDays( ) > 0 ? 'premium' : 'free' ).' account.' );
			}
			else
			{
				if ( $character->getLastLogin( ) == 0 )
				{
					$image->applyString( 'has never been seen.' );
				}
				else
				{
					$image->applyString( 'was last seen' )->applySpacer( 5 );
					$image->applyString( ago( $character->getLastLogin( ) ), 0, 0, TRUE, $injectionSettings['colourKeywords'] )->applySpacer( 5 );
					$image->applyString( 'as a '.( $character->getAccount( )->getPremDays( ) > 0 ? 'premium' : 'free' ).' account.' );
				}
			}
			
			// Add the character equipments to the image object.
			$slots = array( 
				1 => array( 350, 8 ),	 # Helmet
				2 => array( 318, 18 ),	 # Amulet
				3 => array( 382, 18 ),	 # Backpack
				4 => array( 350, 40 ),	 # Armor
				5 => array( 318, 50 ),	 # Right hand
				6 => array( 382, 50 ),	 # Left hand
				7 => array( 350, 72 ),	 # Legs
				8 => array( 350, 104 ),	 # Boots
				9 => array( 318, 82 ),	 # Ring
				10 => array( 382, 82 )	 # Ammunition
			);
			
			// Loop through all of the returned items.
			foreach( $info as $id => $item )
			{
				// Continue the loop in case a match was not found within the slots array.
				if ( !array_key_exists( $item['pid'], $slots ) )
				{
					continue;
				}
				
				// Continue the loop in case an item id was not set.
				if ( is_null( $item['itemtype'] ) )
				{
					continue;
				}
				
				// Set the default count to one.
				$count = ( $item['count'] > 0 ? $item['count'] : 1 );
				
				// Set the image path.
				$imagePath = BASEPATH.'/public/images/items/'.( $count > 1 ? $item['itemtype'].'/'.$count : $item['itemtype'] ).'.gif';
				
				// Create an image in case the current image does not exist already.
				if ( !file_exists( $imagePath ) )
				{
					// Set the two required variables.
					list( $myId, $myCount ) = array( $item['itemtype'], $count );
					// Include the image creation script.
					include( INJECTIONPATH.'/system/CreateItem.class.php' );
				}
				
				
				// Check if the image exists after attempting to create it.
				if ( file_exists( $imagePath ) )
				{
					// Add the item to the proper position.
					$image->applyIcon( $imagePath, $slots[$item['pid']][0], $slots[$item['pid']][1] );
				}
			}
			
			
			// Save the cache.
			$cache->saveCache( );
		}
		// Load the cache.
		$cache->loadCache( );
	}
	
	ob_end_flush( );

 

 

 

 

Eu gostaria que a outfit ficasse +- neste ponto. 

AVvXsEhvIYvys8AaaXnKP8QAENBoNvGMaFIM1O1j

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.9k

Informação Importante

Confirmação de Termo