• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Storage Gesior

nokia_.

Member
Joined
Sep 16, 2010
Messages
109
Reaction score
5
Hello guys, I'm trying to get a script here and I'm not getting

Code:
$quests = array(
    100001 => "Aura1",
    100002 => "Aura2",
    100003 => "Aura3",
);
$main_content .= '<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=3 CLASS=white><B>Quests Information</B></TD></TR>';
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><td width=5%><center><b>Id.</b></center></td><td width=87%><b>Quest</b></td><td width=8%><b><center>Status</center></b></td></tr>';
$i = 1;
foreach($quests as $key => $value){
    if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
if($player->getStorage($key) == 1){
        $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><td width=5%><center>'.$i.'.</center></td><td width=87%>'.$value.'</td><td align="center" width=8%><img src="true.png" title="Done!"/></td></tr>';
} $i++;
}
$main_content .= "</table>";

example of how would be:

OsryfPP.png


is not going , he wanted to show the storage only if you if you have not goes blank characters.php Gęsior
 
handle and makes a query query on checking bank if the player has the storage or not for me I find it easy.
 
This?

PHP:
$quests = array(100001 => "Aura1",  100002 => "Aura2",  100003 => "Aura3");
$status = '';
$main_content .= '<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=3 CLASS=white><B>Quests Information</B></TD></TR>';
if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
  $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><td width=5%><center><b>Id.</b></center></td><td width=87%><b>Quest</b></td><td width=8%><b><center>Status</center></b></td></tr>';
  $i = 1;

foreach($quests as $key => $value){
   if($player->getStorage($key) > 0) {
     $status = 'Done';
  }
  else {
     $status = 'Not Done';
  }
  if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
  $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><td width=5%><center>'.$i.'.</center></td><td width=87%>'.$value.'</td><td align="center" width=8%>'.$status.'</td></tr>';
  $i++;
}
$main_content .= "</table>";
 
Last edited:
@Musztang Only show if you have the storage if you have not shows nothing, same in the picture on the topic, shows only that you have , if you have not shows nothing is hidden, but thanks for trying to help.
 
@Musztang Only show if you have the storage if you have not shows nothing, same in the picture on the topic, shows only that you have , if you have not shows nothing is hidden, but thanks for trying to help.

???


xNtHH0L.png


Edit: If this is not want you want, please explain better.
 
@Musztang It's okay that you posted, working normally, just do not want to show AURA2 AURA3 if you have the storage understand? AURA1 only show if you have the storage, I am Brazilian and I am using a translator, sorry.


If you are STORAGE shows on the site, if you have not not show, just shows if you have.
 
PHP:
  $main_content .= '<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=3 CLASS=white><B>Quests Information</B></TD></TR>';
  if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
  $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><td width=5%><center><b>Id.</b></center></td><td width=80%><b>Quest</b></td><td width=15%><b><center>Status</center></b></td></tr>';

  $i = 1;
  $quests = array(100001 => "Aura1",  100002 => "Aura2",  100003 => "Aura3");

  foreach($quests as $key => $value)
  {
     $storage = $player->getStorage($key);
     if(!empty($storage))
     {
       if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
       $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><td width=5%><center>'.$i.'.</center></td><td width=80%>'.$value.'</td><td align="center" width=15%>Done</td></tr>';
     }
     $i++;
  }

  $main_content .= '</table>';
 
@Musztang Now it does not show anything, even if you have the storage, is blank.

I just test it and seems to work fine.

A3SIf8z.png


3Dr2xax.png


yy5eIfi.png


Edit: btw, if u are adding the storage in-game u have to do save/re-log on the player or wait until global save to update it, also u can add it through a query for a instant update.
 
Last edited:
@Musztang The character is with storage 100003 in the database , but is not showing the characters =( you said it's working, but here is not added the storage re-log, put in the database and nothing.
 
@Musztang The character is with storage 100003 in the database , but is not showing the characters =( you said it's working, but here is not added the storage re-log, put in the database and nothing.

That's weird... i also tested Aura3 with 100003 storage, value 1~

zeP8DACg.png


Anyways, try with this if statements :p

Change
PHP:
if(!empty($storage))
To
PHP:
if($storage)
Or
PHP:
if($storage > 0)
 
Last edited:
@Musztang Weird .. I'm trying the way you went up there, added the storage with value 1, saved, re-log and nothing shows no quest is blank, as if he had the storage.
 
@Musztang Weird .. I'm trying the way you went up there, added the storage with value 1, saved, re-log and nothing shows no quest is blank, as if he had the storage.
PHP:
  $main_content .= '<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=3 CLASS=white><B>Quests Information</B></TD></TR>';
  if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
  $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><td width=5%><center><b>Id.</b></center></td><td width=80%><b>Quest</b></td><td width=15%><b><center>Status</center></b></td></tr>';

  $i = 1;
  $quests = array(100001 => "Aura1", 100002 => "Aura2", 100003 => "Aura3");
  foreach($quests as $key => $name)
  {
     $storage = $SQL->query('SELECT value FROM player_storage WHERE player_id = '.$player->getId().' AND `key` = "'.$key.'";')->fetch();
     if($storage['value'] > 0)
     {
       if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
       $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><td width=5%><center>'.$i.'.</center></td><td width=80%>'.$name.'</b></td><td align="center" width=15%>Done</td></tr>';
       $i++;
     }
  }

  $main_content .= '</table><br/>';
 
Back
Top