[Release] Jewel Deposit

dota-sdso

Well-Known Member
Joined
Apr 30, 2014
Messages
590
Reaction score
822
По принцип модула не е готов на 100% и макар и да работи ще продължа да го развивам когато имам време, защото идеята е съвсем друга и трябва да работи и за нови версии и ресурси/джевели, които в бъдеще да си добавите само с въвеждане на хекса и името на колонката, в която да депозира през админ панел за управление.

Всички, които искат да се включат с ъпдейти са добре дошли за общото фри-благо

PHP:
<!DOCTYPE html>
<head>
  <link rel="stylesheet" href="bank.css">
</head>
<center>
<?php
////////////////////////////////////////////////////////
//////////////////////////////// Created   /////////////
// Jewels Depositor v0.2   /////   for  ////////////////
//////  by r00tme  //////////// DarkSteam///////////////
////// 01/09/2015 //////////////////////////////////////   
//////////////////////////http://darksteam.net///

include('jewel_funcs.php');
$your_table   = '[DPWeb_JewelDeposit]';
$your_acc     = 'memb___id';
$your_session = 'dt_username';


//*Important => The whole script works with this base and needs to be filled correctly!
$jewels_base   = array(/* Jewel Name*/      /*Jewel Hex*/        /* Jewel Column*/    /*first four*/
                 array('bless',             'CD00FF00000000800000',       'bless',             'CD00' ),
				 array('soul' ,             'CE00FF00000000800000',        'soul',             'CE00' ),
				 array('life',              'D601FF00000000800000',        'life',             'D601' ),
				 array('creation',          'D001FF00000000800000',    'creation',             'D001' ),
				 array('rena',              'D500FF00000000800000',        'rena',             'D500' ),
                 array('chaos',             '8F00FF00000000800000',       'chaos',             '8F00' ),	
                 array('guardian',          'DF00FF00000000800000',       'guardian',          'DF00' ),
				 array('stone',             'D508FF00000000800000',       'stone',             'D508' ),	
                 array('secret',            '9A00FF00000000800000',        'secret',           '9A00' ),	
                 array('blessmix1',        '9E00FF00000000800000',        'blessmix1',         '9E00' ),	
                 array('blessmix2',        '9E08FF00000000800000',        'blessmix2',         '9E08' ),
                 array('blessmix3',        '9E10FF00000000800000',        'blessmix3',         '9E10' ),	
                 array('soulmix1',         '9F00FF00000000800000',        'soulmix1',          '9F00' ),	
                 array('soulmix2',         '9F08FF00000000800000',        'soulmix2',          '9F08' ),
                 array('soulmix3',         '9F10FF00000000800000',        'soulmix3',          '9F10' )				
				 );
				 
define('ITEM_LENGTH', 20);
define('WAREHOUSE_LENGTH', 1200);
  $type = secure($_POST["type"]);
  $count = secure($_POST["count"]);
  $username = $_SESSION[''.$your_session.''];			 
  $queryonline = mssql_num_rows(mssql_query("Select * from MEMB_STAT where memb___id='{$username}' and connectstat='1'"));
		 
        for( $i= 0 ; $i <= count($jewels_base)-1 ; $i++ ){
        if ($type == $jewels_base[$i][0]){
        	$jewels_name =$jewels_base[$i][0];
        	$jewels_hex  =  $jewels_base[$i][1];
        	$jewels_column = $jewels_base[$i][2];
        	$jewels_4 = $jewels_base[$i][3];
         }
        }	
       echo "<div class='general'>";

if($_POST['deposit']){

if( $queryonline == 1){
	echo "You can't deposit now, leave the game first";
 } 
else{
$warehouse = market_warehouse($username);
	foreach($warehouse as $item){
	   for( $i= 0 ; $i <= count($jewels_base)-1 ; $i++ ){
         if ($type == $jewels_base[$i][0]){
	         $jewels_name =$jewels_base[$i][0];
	         $jewels_hex  =  $jewels_base[$i][1];
	         $jewels_column = $jewels_base[$i][2];
	         $jewels_4 = $jewels_base[$i][3];
	    if($item['hex'] == $jewels_4){
		 $jewela++;
	        }
	      }
        }
      }
		
	 if($type == $jewels_name && $jewela>= $count && $jewela>0 && $count>0){
		
		$warehouse = market_warehouse($username);
		$counter = 0;
		
		foreach($warehouse as $item){
			if($item['hex'] == $jewels_4){
				
				$item_position = $item['item_position'];
				$item_length = ITEM_LENGTH;

				$current_items = warehouse_items($username);
				
				$items	= substr($current_items,2);
				$i = -1;
				$num=0;
				while($i < 119){	
					$i++;
					if($i == $item_position && $num==0)
					{
						$items= substr_replace($items,str_repeat('F',$item_length),($i*$item_length), $item_length);
						$num++;
					}
				}
				mssql_query("UPDATE [warehouse] SET [items]=0x".$items." WHERE [AccountId]='".$username."'");
				$counter++;
				
				if($counter == $count)
				{
					break;
				}

			 }
	      } 

		mssql_query("UPDATE ".$your_table." SET ".$jewels_column."=".$jewels_column."+".$count." WHERE ".$your_acc."='".$username."'");
	    echo "<span class='success'>Your deposit was sucessfull</span>";
	}
		elseif(empty($count)){
		echo"<span class='error'>Do not leave empty fields!</span>";
		}
	else {
		echo "<span class='error'>You dont have these jewels!</span>";
	}
  }
}

if($_POST['withdraw']){

if( $queryonline == 1){
	echo "You can't withraw now, leave the game first";
 } 
 else{  
 	$jewels = mssql_fetch_array(mssql_query("select * from ".$your_table." where ".$your_acc."='".$username."'"));
	if($type==$jewels_name && $jewels[''.$jewels_name.'']>=$count && $jewels[''.$jewels_name.'']>0 && $count > 0){
		for($i = 0;$i<$count;$i++)
		{
			$item_length = ITEM_LENGTH;
			$query = mssql_fetch_row(mssql_query("exec WZ_GetItemSerial"));
			$serial = sprintf("%08X", $query[0], 00000000);
			
			$mycuritems = warehouse_items($username);
			$newitems = $jewels_hex;
			$newitem = str_replace("00000000", $serial, $newitems);
			
			$slot = smartsearch($mycuritems,1,1);
			$test = $slot * $item_length;

			if ($slot==1337)
			{
				echo "<span class='error'>Not enough free space in the vault!</span>";
				break;
			}

			else
			{
				$mynewitems = substr_replace($mycuritems, $newitem, ($test+2), $item_length);
				mssql_query("
					UPDATE [warehouse] SET [Items]=".$mynewitems." WHERE [AccountId]='".$username."';
					UPDATE  ".$your_table." set ".$jewels_column."= ".$jewels_column."-1 WHERE ".$your_acc."='".$username."';");		
			}
		}
		echo "<span class='success'>Your withdrawal was sucessfull</span>";
	}
				elseif(empty($count)){
				echo"<span class='error'>Do not leave empty fields!</span>";
			}
		else{
		echo "<span class='error'>You dont have these jewels!</span>";
	}
   }
 }
        echo "<div class='relative'>";
        echo "<table class='table' border='1' align='left'>
			      <tr>
				     <td class='tdhead' colspan='2'>Web Bank Jewels</td>
				  </tr>";
		for( $i= 0 ; $i <= count($jewels_base)-1 ; $i++ ){
	     $jewels_name   = $jewels_base[$i][0];
	     $jewels_column = $jewels_base[$i][2];
	     $jewel_count   = 0;

	     $select_bank = mssql_fetch_array(mssql_query("select * from ".$your_table." where ".$your_acc."='".$username."'"));
		 if ($select_bank[''.$jewels_column.''] == null ){
			 $select_bank[''.$jewels_column.''] = 0;
		 }
		 else {
			 $select_bank[''.$jewels_column.'']= $select_bank[''.$jewels_column.''];
		 }
	 echo "
	      <tr><td class='td'>" . $jewels_name . "    </td><td class='tdinf'>".$select_bank[''.$jewels_column.'']."</td></tr>";}
	 echo "
		  </table>
		    <table align='left' class='table_mid' > 
			     <form method='post'>
			  <tr>
			    <td class='tdhead' width='50px'>Count</td>
			    <td class='tdhead' width='100px'>Jewel</td>
				<td class='tdhead' colspan='2' width='100px'>Action</td>
			  </tr>
			  <tr><td class='td'><input type='number' min='1' max='500' name='count'/></td>
	             <td class='td'> <select name='type' id='type'> ";
				 
				 for( $i= 0 ; $i <= count($jewels_base)-1 ; $i++ ){
	                  $jewels_name = $jewels_base[$i][0];
					  
		 echo "<option value='".$jewels_name."'>    Jewel Of ".$jewels_name." </option>";}
	     echo "</select>
				  <td class='td'>
		            <input type='submit' class='putoni' name='deposit' value='Deposit'/></td>
		          <td class='td'>
			        <input type='submit' class='putoni' name='withdraw' value='Withdraw'/></td>
				</tr>
             </form>		 
		   </table>
		   
        <table class='table' border='1' align='left'>
			     <tr><td class='tdhead' colspan='2'>Warehouse Jewels</td></tr>";
	    for( $i= 0 ; $i <= count($jewels_base)-1 ; $i++ ){
	         $jewels_name = $jewels_base[$i][0];
			  $jewels_4 = $jewels_base[$i][3];
	         $jewel_count = 0;
			 
         $warehouse = market_warehouse($username);
	        foreach($warehouse as $item){
				
	          if($item['hex'] == $jewels_4){
	    	    $jewel_count++;
	            }
	          }
              echo "<tr><td class='td'>".$jewels_name."</td><td class='tdinf'> ".$jewel_count."</td></tr>"; 	  
            }
    echo "</table>";
	echo "</div>";


?>
<style>


.general{
	position:absolute;
	margin-top:10px;
	background:#000000;
	border-radius:10px 10px 10px 10px;
	width:600px;
	height:500px;
	border:2px solid #555;
	text-align:center;
}
.relative{
	margin-top:10px;
	margin-left:15px;
}
</style>
 

Attachments

  • DarkSteam Jewel_Depositor v0.3.rar
    6.6 KB · Views: 134
Last edited:
Update 0.2

Ъпдейт 0.2

Добавено:
1. Проверка за онлайн на акаунта
2. Промяна на функцията за да работи с първите 4 знака от хекса (D508-рена и т.н)
3. Динамично добавяне на нов джевел/ресурс за депозиране във формата и таблиците съндък и банка
3. Започна работата по админ панела (готов на 90%), но не е имплантиран в този ъпдейт

Остава да се направи:

1.Функционален админ панел за добавяне, изтриване или едитване на нови предмети/джевели за депозит. Създаване на нов депозитер и колонка в посочена таблица в самият конфиг.

2. Възможност за динамична смяна на функциите и работа с по-нови версии

Потребителски модул
F66hLOJ.jpg


Админ модул
OksEKAw.jpg


https://www.youtube.com/watch?v=fb29WViyF5U
 
Take the code snippet, create module in ur web, configure it for use with your variables/db...
 
  • Like
Reactions: dota-sdso
The Last is right, but download the archive do need to create new modules you have them in the archive. I will not update the snippet this is just for basic information how it works.
So you have all needed modules in hand only have to configure. And remember the module works only with the old (97D/99XT) versions for now. For the new versions it need a switch and different functions to work. This will be made later on, when the admin panel is done will have an option to switch the versions from there. Adding newor editing the existing items for deposit
 
Препоръчвам ти да качиш и една MSSQL таблица, която да работи с настройките по подразбиране. Може да има хора, които няма да се справят с тази задача и това би ги отказало да ползват модула. :)
 
  • Like
Reactions: dota-sdso
Препоръчвам ти да качиш и една MSSQL таблица, която да работи с настройките по подразбиране. Може да има хора, които няма да се справят с тази задача и това би ги отказало да ползват модула. :)

Прав си, добавих я в архива, мерси RaFa. Но така или иначе това няма да окончатленият вариант, може би ще направя вид инсталация, в която ще се избира името на таблицата и видовете джевели/предмети за депозит още в началото и вече ще се едитват в последствие в панела.. Засега така ще бъде с ръчно добавяне и заменяне на таблиците и колонките в скрипта.
 
Прав си, добавих я в архива, мерси RaFa. Но така или иначе това няма да окончатленият вариант, може би ще направя вид инсталация, в която ще се избира името на таблицата и видовете джевели/предмети за депозит още в началото и вече ще се едитват в последствие в панела.. Засега така ще бъде с ръчно добавяне и заменяне на таблиците и колонките в скрипта.

Според мен трябва да дадеш една фиксирана таблица, тъй като иначе могат да възникнат грешки. Примерно избирам таблица, която има задължителна колона за ъпдейт, но скрипта не я ъпдейтва - получава се грешка и потребителя ще изгуби камъка си.

Сега прегледах част от скрипта - какво става, ако потребителя за първи път използва депозит функцията? Доколкото виждам не се прави нов запис, но камъкът се взима от сандъка на потребителя.

Също така виждам, че имаш една заявка, която е вътре в цикъл:

PHP:
for ($i = 0; $i <= count($jewels_base) - 1; $i++) {
........
    $select_bank = mssql_fetch_array(mssql_query("select * from " . $your_table . " where " . $your_acc . "='" . $username . "'"));
........
}

Най-добре я изнеси отгоре, иначе в момента се изпълнява 15 пъти и взима една и съща информация. Иии още една бърза оптимиация за този цикъл:

PHP:
for ($i = 0; $i <= count($jewels_base) - 1; $i++)
=>>
for ($i = 0, $count = count($jewels_base); $i < $count; $i++)
 
  • Like
Reactions: dota-sdso
Update 0.3

Добавeно
+ Проверка за активна сесия
+ Създаване на задължителна таблица, ако не съществува
(* По предварително зададена променлива, име на таблица, акаунт в конфигурацията)
+ Проверка за съществуващ акаунт в таблицата депозит, ако не съществува го създава с 0-леви стойности
+ Проверка при депозит за липсващ акаунт (За всеки случай, макар че е излишно)
+ Подобрение на кода благодарение на предложенията на RaFa

Междо другото идеята, като цяло не е да се едитва самият конфиг, а да се направи с инсталация, в която предварително ще се задава версията на играта, име на колонка, предметите за депозиране и т.н. Макар, че на мен лично не ми харесва но засега става и така, по-добре е от нищо (rofl)

P.S Междо другото, като цяло тези проверки дали потребителя съществува, таблици и т.н трябва да са си при самата регистрация или някъде глобално. Така или иначе без познания всеки ще си има проблеми, ако разчита само но тоя модул особенно в този незавършен вид.
PHP:
<!DOCTYPE html>
<head>
  <link rel="stylesheet" href="bank.css">
</head>
<center>
<?php
////////////////////////////////////////////////////////
//////////////////////////////// Created   /////////////
// Jewels Depositor v0.2   /////   for  ////////////////
//////  by r00tme  //////////// DarkSteam///////////////
////// 01/09/2015 //////////////////////////////////////   
//////////////////////////http://darksteam.net///

include('jewel_funcs.php');

//*Important => The whole script works with this base and needs to be filled correctly!
$jewels_base   = array(/* Jewel Name*/      /*Jewel Hex*/        /* Jewel Column*/    /*first four*/
                 array('bless',             'CD00FF00000000800000',       'bless',             'CD00', '0'),
				 array('soul' ,             'CE00FF00000000800000',        'soul',             'CE00', '0'),
				 array('life',              'D601FF00000000800000',        'life',             'D601', '0'),
				 array('creation',          'D001FF00000000800000',    'creation',             'D001', '0'),
				 array('rena',              'D500FF00000000800000',        'rena',             'D500', '0'),
                 array('chaos',             '8F00FF00000000800000',       'chaos',             '8F00', '0'),	
                 array('guardian',          'DF00FF00000000800000',       'guardian',          'DF00', '0'),
				 array('stone',             'D508FF00000000800000',       'stone',             'D508', '0'),	
                 array('secret',            '9A00FF00000000800000',        'secret',           '9A00', '0'),	
                 array('blessmix1',        '9E00FF00000000800000',        'blessmix1',         '9E00', '0'),	
                 array('blessmix2',        '9E08FF00000000800000',        'blessmix2',         '9E08', '0'),
                 array('blessmix3',        '9E10FF00000000800000',        'blessmix3',         '9E10', '0'),	
                 array('soulmix1',         '9F00FF00000000800000',        'soulmix1',          '9F00', '0'),	
                 array('soulmix2',         '9F08FF00000000800000',        'soulmix2',          '9F08', '0'),
                 array('soulmix3',         '9F10FF00000000800000',        'soulmix3',          '9F10', '0')				
				 );
/////////////////////////////////////////////////////////////////////////////////////////////////////

$your_table       = '[DPWeb_JewelDeposit]';
$your_acc         = 'memb___id';
$your_session     = 'dt_username';	 

$type = strip_tags($_POST["type"]);
$count = strip_tags($_POST["count"]);
$username = $_SESSION[''.$your_session.''];	
////////////////////////////////////////////////////////////////////////////////////////////////////
	
 if (!$_SESSION[''.$your_session.'']){
           echo "You have to login first";
          }
   else {
       $check_exist  = mssql_query("SELECT 1 from ".$your_table."");
        if (!$check_exist){
         	mssql_query("		
         	CREATE TABLE [".$your_table."](
         	[".$your_acc ."] [varchar](15) NOT NULL,
         	[bless]     [int] NOT NULL DEFAULT ((0)),
         	[soul]      [int] NOT NULL DEFAULT ((0)),
         	[chaos]     [int] NOT NULL DEFAULT ((0)),
         	[life]      [int] NOT NULL DEFAULT ((0)),
         	[creation]  [int] NOT NULL DEFAULT ((0)),
         	[guardian]  [int] NOT NULL DEFAULT ((0)),
         	[soulmix1]  [int] NOT NULL DEFAULT ((0)),
         	[soulmix2]  [int] NOT NULL DEFAULT ((0)),
         	[soulmix3]  [int] NOT NULL DEFAULT ((0)),
         	[blessmix1] [int] NOT NULL DEFAULT ((0)),
         	[blessmix2] [int] NOT NULL DEFAULT ((0)),
         	[blessmix3] [int] NOT NULL DEFAULT ((0)),
         	[stone]     [int] NOT NULL DEFAULT ((0)),
         	[rena]      [int] NULL DEFAULT ((0)),
         	[secret]    [int] NOT NULL DEFAULT ((0))
			)");
		 }
	  $check_acc = mssql_fetch_row(mssql_query("Select * from ".$your_table." where ".$your_acc ." = '".$username."'")); 
      if(!$check_acc ){
                 mssql_query("Insert into ".$your_table." (".$your_acc .",[bless],[soul],[chaos],[life],[creation],[guardian],[soulmix1],[soulmix2],[soulmix3],[blessmix1],[blessmix2],[blessmix3],[stone],[rena],[secret]) values ('".$username."', '0','0','0','0','0','0','0','0','0','0','0','0','0','0','0')");
	     }
  define('ITEM_LENGTH', 20);
  define('WAREHOUSE_LENGTH', 1200);		 
  $queryonline = mssql_num_rows(mssql_query("Select * from MEMB_STAT where memb___id='{$username}' and connectstat='1'")); 
  $select_bank = mssql_fetch_array(mssql_query("select * from ".$your_table." where ".$your_acc."='".$username."'"));

       echo "<div class='general'>";

  if($_POST['deposit']){
      if( $queryonline == 1){
      	echo "You can't deposit now, leave the game first";
       } 
      elseif(!$check_acc){ 
        echo "There is a problem with the module, contact the administrator for more information";
            } 
      else{
      $warehouse = market_warehouse($username);
      	foreach($warehouse as $item){
      	   for ($i = 0, $count = count($jewels_base); $i < $count; $i++)  {
               if ($type == $jewels_base[$i][0]){
      	         $jewels_name =$jewels_base[$i][0];
      	         $jewels_hex  =  $jewels_base[$i][1];
      	         $jewels_column = $jewels_base[$i][2];
      	         $jewels_4 = $jewels_base[$i][3];
      	    if($item['hex'] == $jewels_4){
      		 $jewela++;
      	        }
      	      }
            }
           }
      		
      	 if($type == $jewels_name && $jewela>= $count && $jewela>0 && $count>0){
      		
      		$warehouse = market_warehouse($username);
      		$counter = 0;
      		
      		foreach($warehouse as $item){
      			if($item['hex'] == $jewels_4){
      				
      				$item_position = $item['item_position'];
      				$item_length = ITEM_LENGTH;
      
      				$current_items = warehouse_items($username);
      				
      				$items	= substr($current_items,2);
      				$i = -1;
      				$num=0;
      				while($i < 119){	
      					$i++;
      					if($i == $item_position && $num==0)
      					{
      						$items= substr_replace($items,str_repeat('F',$item_length),($i*$item_length), $item_length);
      						$num++;
      					}
      				}
      				mssql_query("UPDATE [warehouse] SET [items]=0x".$items." WHERE [AccountId]='".$username."'");
      				$counter++;
      				
      				if($counter == $count)
      				{
      					break;
      				}
      
      			 }
      	      } 
      
		mssql_query("UPDATE ".$your_table." SET ".$jewels_column."=".$jewels_column."+".$count." WHERE ".$your_acc."='".$username."'");
	    echo "<span class='success'>Your deposit was sucessfull</span>";
	}
		elseif(empty($count)){
		echo"<span class='error'>Do not leave empty fields!</span>";
		}
	else {
		echo "<span class='error'>You dont have these jewels!</span>";
	}
  }
}

if($_POST['withdraw']){

if( $queryonline == 1){
	echo "You can't withraw now, leave the game first";
 } 
 else{  
 	$jewels = mssql_fetch_array(mssql_query("select * from ".$your_table." where ".$your_acc."='".$username."'"));
	if($type==$jewels_name && $jewels[''.$jewels_name.'']>=$count && $jewels[''.$jewels_name.'']>0 && $count > 0){
		for($i = 0;$i<$count;$i++)
		{
			$item_length = ITEM_LENGTH;
			$query = mssql_fetch_row(mssql_query("exec WZ_GetItemSerial"));
			$serial = sprintf("%08X", $query[0], 00000000);
			
			$mycuritems = warehouse_items($username);
			$newitems = $jewels_hex;
			$newitem = str_replace("00000000", $serial, $newitems);
			
			$slot = smartsearch($mycuritems,1,1);
			$test = $slot * $item_length;

			if ($slot==1337)
			{
				echo "<span class='error'>Not enough free space in the vault!</span>";
				break;
			}

			else
			{
				$mynewitems = substr_replace($mycuritems, $newitem, ($test+2), $item_length);
				mssql_query("
					UPDATE [warehouse] SET [Items]=".$mynewitems." WHERE [AccountId]='".$username."';
					UPDATE  ".$your_table." set ".$jewels_column."= ".$jewels_column."-1 WHERE ".$your_acc."='".$username."';");		
			}
		}
		echo "<span class='success'>Your withdrawal was sucessfull</span>";
	}
				elseif(empty($count)){
				echo"<span class='error'>Do not leave empty fields!</span>";
			}
		else{
		echo "<span class='error'>You dont have these jewels!</span>";
	}
   }
 }
        echo "<div class='relative'>";
        echo "<table class='table' border='1' align='left'>
			      <tr>
				     <td class='tdhead' colspan='2'>Web Bank Jewels</td>
				  </tr>";
		for ($i = 0, $count = count($jewels_base); $i < $count; $i++) {
	     $jewels_name   = $jewels_base[$i][0];
	     $jewels_column = $jewels_base[$i][2];
	     $jewel_count   = 0;
		 if ($select_bank[''.$jewels_column.''] == null ){
			 $select_bank[''.$jewels_column.''] = 0;
		 }
		 else {
			 $select_bank[''.$jewels_column.'']= $select_bank[''.$jewels_column.''];
		 }
	 echo "
	      <tr><td class='td'>" . $jewels_name . "    </td><td class='tdinf'>".$select_bank[''.$jewels_column.'']."</td></tr>";}
	 echo "
		  </table>
		    <table align='left' class='table_mid' > 
			     <form method='post'>
			  <tr>
			    <td class='tdhead' width='50px'>Count</td>
			    <td class='tdhead' width='100px'>Jewel</td>
				<td class='tdhead' colspan='2' width='100px'>Action</td>
			  </tr>
			  <tr><td class='td'><input type='number' min='1' max='500' name='count'/></td>
	             <td class='td'> <select name='type' id='type'> ";
				 
				 for ($i = 0, $count = count($jewels_base); $i < $count; $i++) {
	                  $jewels_name = $jewels_base[$i][0];
					  
		 echo "<option value='".$jewels_name."'>    Jewel Of ".$jewels_name." </option>";}
	     echo "</select>
				  <td class='td'>
		            <input type='submit' class='putoni' name='deposit' value='Deposit'/></td>
		          <td class='td'>
			        <input type='submit' class='putoni' name='withdraw' value='Withdraw'/></td>
				</tr>
             </form>		 
		   </table>
		   
        <table class='table' border='1' align='left'>
			     <tr><td class='tdhead' colspan='2'>Warehouse Jewels</td></tr>";
	   for ($i = 0, $count = count($jewels_base); $i < $count; $i++) {
	         $jewels_name = $jewels_base[$i][0];
			  $jewels_4 = $jewels_base[$i][3];
	         $jewel_count = 0;
			 
         $warehouse = market_warehouse($username);
	        foreach($warehouse as $item){
				
	          if($item['hex'] == $jewels_4){
	    	    $jewel_count++;
	            }
	          }
              echo "<tr><td class='td'>".$jewels_name."</td><td class='tdinf'> ".$jewel_count."</td></tr>"; 	  
            }
    echo "</table>";
	echo "</div>";
   }

?>
<style>


.general{
	position:absolute;
	margin-top:10px;
	background:#000000;
	border-radius:10px 10px 10px 10px;
	width:600px;
	height:500px;
	border:2px solid #555;
	text-align:center;
}
.relative{
	margin-top:10px;
	margin-left:15px;
}
</style>
 
Last edited:
  • Like
Reactions: RaFa and ludlud
Евала за труда :) Когато имам повечко фрий тайм може да ударя 1 рамо за HEX кодовете с дължина 32
 
  • Like
Reactions: dota-sdso
Unfortunately I found a bug and do not advice you to use it on real server, but if you want to test it I will prepare a tables for you, just pm me

I have another projects working on and don't have a time to fix it up now

It will be released only in this forum under this post when is completely finished
 
I found the problem. It's stupid one after version 0.2 to 0.3 we did this
PHP:
for ($i = 0; $i <= count($jewels_base) - 1; $i++)
=>>
for ($i = 0, $count = count($jewels_base); $i < $count; $i++)

which is very good suggestion and better looking code, but I didn't check it and just but replace and update the version from 0.2 to 0.3

Actually the problem was that I used the $count variable as a POST request and in this case we just overwriting the existing variable ...

I was wondering why the people saying it's not working and today I took a look into the code and found this issue, so basically you have to replace $count with $max for example to make it works. It only do a counting of the array (resources) maximum and helping the for looping to count until reach it. So it doesn't matter what variable name you gonna use.

Anyway I may update this module in the next few days
 
Last edited:
I found the problem. It's stupid one after version 0.2 to 0.3 we did this
PHP:
for ($i = 0; $i <= count($jewels_base) - 1; $i++)
=>>
for ($i = 0, $count = count($jewels_base); $i < $count; $i++)
which is very good suggestion and better looking code, but I didn't check it and just but replace and update the version from 0.2 to 0.3

Actually the problem was that use the variable $count as a POST request and in this case we just overwriting the existing variable ...

I was wondering why the people saying it's not working and today I took a look into the code and found this issue, so basically you have to replace $count with $max for example to make it works. It only do a counting of the array (resources) maximum and helping the for looping to count until reach it. So it doesn't matter what variable name you gonna use.

Anyway I may update this module in the next few days

Sorry about that! (wasntme)
 
А, глупости твоето предложение си е актуално в пълна сила. Toва, че ти си предложил не означава, че аз пък не трябва да го проверя всичко преди да го ъплоадна.. така, аз съм си виновен. Ще го оправим тези дни, то трябва и да се довърши, като хората
 
Last edited: