• 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!

[Gesior AAC] Quest Status in characters.php v2

Norix

Hosting Service !
Joined
Jan 18, 2008
Messages
544
Reaction score
8
Location
Germany
Hi

I will show you now how you show quest status in your characters side. I fixed it now abit so you its more handy and easier to configure.

Here is Script:
PHP:
            //quest status by ballack13
            $id = $player->getCustomField("id");
            $number_of_quests = 0;
            $main_content .= '<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Quests</B></TD></TR>';        
                        $quests = array('Annihilator' => 5000,'Demon Helmet' => 2645,); 
                        foreach ($quests as $storage => $name) {
                if(is_int($number_of_quests / 2))
                    $bgcolor = $config['site']['darkborder'];
                else
                    $bgcolor = $config['site']['lightborder'];
                $number_of_quests++;
            $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=70%>'.$storage.'</TD>';
                        $quest = $SQL->query('SELECT * FROM player_storage WHERE player_id = '.$id.' AND `key` = '.$quests[$storage].';')->fetch();
                           if($quest == false) {
            $main_content .= '<TD><img src="http://otland.net/images/false.png"/></TD></TR>';
                        }
            else
            {
            $main_content .= '<TD><img src="http://otland.net/images/true.png"/></TD></TR>';
            }
            }
            $main_content .= '</TABLE>';
            //end of quest status by ballack13
Now you need to configure the quest. For this you need this line:
PHP:
$quests = array('QUESTNAME1' => STORAGE1,'QUESTNAME2' => STORAGE2,);
You need to change only the Questnames and the storages of the quest (best if you take Reward Storage). You can add as many quests as you want to.

Now you have to implent it in your characters.php file.
Go to the part above the Death list Part (~line 75) and past the code there. Then it should work.
Finally download the images of attachement and put them into images folder.

Rep++ !!
Your's ballack13
 

Attachments

Last edited by a moderator:
Awsome dude! I love your scripts and you helped me with my daopay shop so i will be forever thankful! Rep++ forever!
 
Code:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'STORAGE' in 'where clause'' in C:\xampp\htdocs\ot\characters.php:91 Stack trace: #0 C:\xampp\htdocs\ot\characters.php(91): PDO->query('SELECT * FROM `...') #1 C:\xampp\htdocs\ot\index.php(94): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\ot\characters.php on line 91

help plis :D!
 
Code:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'STORAGE' in 'where clause'' in C:\xampp\htdocs\ot\characters.php:91 Stack trace: #0 C:\xampp\htdocs\ot\characters.php(91): PDO->query('SELECT * FROM `...') #1 C:\xampp\htdocs\ot\index.php(94): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\ot\characters.php on line 91

help plis :D!

you should edit "STORAGE" to a number of storage you want to show :)
 
It rly suck this way ;)

Made it like I got it:

$quests = array(
"KOOLEST QUEST" => storage,
"KOOL QUEST" => storage_2,
);

Isnt it a little better way? :)
 
PHP:
$quest = $SQL->query('SELECT * FROM '.$SQL->tableName('player_storage').' WHERE player_id = '.$id.' AND `key` = STORAGE;')->fetch();
You have there pot, then why don't use POt's functions?
 
Hi
I will show you now how you show quest status in your characters side.

You need this lines for it:
PHP:
			$id = $player->getCustomField("id");
			$main_content .= '<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Quests</B></TD></TR>';		
			$main_content .= '<TR BGCOLOR="'.$config['site']['darkborder'].'"><TD WIDTH=70%>QUEST NAME</TD>';
                        $quest = $SQL->query('SELECT * FROM '.$SQL->tableName('player_storage').' WHERE player_id = '.$id.' AND `key` = STORAGE;')->fetch();
                           if($quest == false) {
			$main_content .= '<TD><img src="http://otland.net/images/false.png"/></TD></TR></TABLE>';
                        }
			else
			{
			$main_content .= '<TD><img src="http://otland.net/images/true.png"/></TD></TR></TABLE>';
			}
Now you have to change the storage to the storage of the quest(best if you take from reward). Then it will show if its done/not done.
Now if you wanna have more quests then it should look like this: (this is example for 2 quests)
PHP:
			$id = $player->getCustomField("id");
			$main_content .= '<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Quests</B></TD></TR>';		
			$main_content .= '<TR BGCOLOR="'.$config['site']['darkborder'].'"><TD WIDTH=70%>QUEST NAME</TD>';
                        $quest = $SQL->query('SELECT * FROM '.$SQL->tableName('player_storage').' WHERE player_id = '.$id.' AND `key` = STORAGE;')->fetch();
                           if($quest == false) {
			$main_content .= '<TD><img src="http://otland.net/images/false.png"/></TD></TR>';
                        }
			else
			{
			$main_content .= '<TD><img src="http://otland.net/images/true.png"/></TD></TR>';
			}
			$main_content .= '<TR BGCOLOR="'.$config['site']['lightborder'].'"><TD WIDTH=70%>QUEST NAME</TD>';
                        $quest = $SQL->query('SELECT * FROM '.$SQL->tableName('player_storage').' WHERE player_id = '.$id.' AND `key` = STORAGE;')->fetch();
                           if($quest == false) {
			$main_content .= '<TD><img src="http://otland.net/images/false.png"/></TD></TR></TABLE>';
                        }
			else
			{
			$main_content .= '<TD><img src="http://otland.net/images/true.png"/></TD></TR></TABLE>';
			}

Now you have to implent it in your characters.php file.
Go to the part above the Death list Part (~line 75) and past the code there. Then it should work. ;)
Finally download the images of attachement and put them into images folder.
Rep++ !!
Your's ballack13

u are my pro Ok????11?!

thanks
 
I updated the Script. Now its easier to implent it. I have already sent it to Mod. He has to edit it now ;)
 
Moderator Message: Thread updated to a newer version requested by the user.

Thread modified.
 
it's mine script:
PHP:
$key = array(1 => '100', '5050', '2645', '42361', '42371', '42381', '2415', '8883', '8891', '8887', '8858', '7429', '8903', '2498', '2407', '2476');
$quest = array( 100 => "Annihilator", 5050 => "Pits of Inferno", 2645 => "Demon Helmet Quest", 42361 => "Svargrond Arena Greenhorn", 42371 => "Svargrond Arena Scrapper", 42381 => "Svargrond Arena Warlord", 2415 => "Warlock Quest", 8883 => "Fury Quest", 8891 => "Barbarian Quest", 8887 => "Ice Witch Quest", 8858 => "Frost Dragon Quest I", 7429 => "Frost Dragon Quest II", 8903 => "Wyrm Quest", 2498 => "Black Knight Quest", 2407 => "Hero Quest", 2476 => "Orc Fortress Quest");
$main_content .= '<br><div id="button_quest"><input id="quest_button" type="button" value="Quests - show" class="input4" onclick="showHidden(\'quest\', \'quest_button\', \'Quests - show\', \'Quests - hide\')"/></div><div id="quest" style="display: none;">
<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($key as $zrobione){
	if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
if($player->getStorage($zrobione) == 1){
		$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><td width=5%><center>'.$i.'.</center></td><td width=87%>'.$quest[$zrobione].'</td><td align="center" width=8%><img src="true.png" title="Done!"/></td></tr>';
}
else
{
	$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><td width=5%><center>'.$i.'.</center></td><td width=87%>'.$quest[$zrobione].'</td><td align="center" width=8%><img src="false.png" title="Not Done!"/></td></tr>';
} $i++;
}
$main_content .= "</table></div>";
 
i dont really understand what do i need to write on storage id
what does storage id mean?

sry doublepost cant edit...

how do i set this up?
because my quests are scripted on rme map editor without a .lua file
 
Last edited by a moderator:
If you make a quest and finish it you get a storage id of id. Else you could do it XX times...
In your scripts you set up which storage you give (take the storage from reward) to the players with this line:
Code:
setPlayerStorageValue(cid, 4920, 1)
And in this case the storage id is 4920 so you would have to write in the config of quest status after the name this id...
 
Back
Top