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

zapisywanie danego lvl na stale w bazie danych

Pawcio6

Member
Joined
Sep 26, 2009
Messages
143
Solutions
4
Reaction score
15
Witam
Mam problem z funkcja(lua) ktora zapisze lvl na ktorym zrobila dana osoba quest i ten level bedzie na stale chodzi mi o to ze gdy wykona quest np na 300 lvl to zapisze to w bazie danych i to nie bedzie sie zmieniac i potem bedzie mozna dodac do modern aac by przy zprawdzaniu danej osoby pokazywal lvl na ktorym zrobil quest czyli 300
z gory dziekuje :)
 
zrób w sobie w players_storage kolumne level, w której będzie zapisywać poziom, na którym id zdobył ten storage
 
zrób w sobie w players_storage kolumne level, w której będzie zapisywać poziom, na którym id zdobył ten storage

on nie ogarnie potem jak to zrobić, ale rozwiązanie dobre :)

# temat
możesz to do bazy od razu itp., a możesz wykorzystywać dodatkowe storagi

np.
setPlayerStorageValue(cid, questStorage, getPlayerLevel(cid))

i dzięki temu, zapiszesz sobie value, bo questy skrzynkowe działają zawykle na zasadzie

if getPlayerStorageValue(cid, key, value) < 1 then

wiec jak potem zmienisz value na level tym sposobem co podałem, to nadal będzie all git, a mniej roboty :D
 
dzieki :)
mam jeszcze jedna prosbe majac taki skrypt w aac
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$characterPageQuests = array();
/* A list of quests for character/view page. It will be listed on the page as a table to show acomplished missions.
Array contains array of quests which includes STORAGE ID, STORAGE VALUE (Required to finish quest) and NAME
To create new quest copy line accross and change values.
*/
$player = $GLOBALS['player'];
/* Eg. $characterPageQuests[] = array('storage'=>5000, 'value'=>1, 'name'=>'Demon Helmet Quest'); */
$characterPageQuests[] = array('storage'=>5000, 'value'=>1, 'name'=>'Reborn');


if(count($characterPageQuests) != 0) {
echo "<div class='bar'>Quests</div>";
echo "<table width='100%'>";
echo "<tr><td width='90%'><center><b>Quest Name</b></center></td><td><b><center>Reborn Level</center></b></td></tr>";
$SQL = POT::getInstance()->getDBHandle();
foreach($characterPageQuests as $value) {
$quest = $SQL->query("SELECT `value` FROM `player_storage` WHERE `player_id` = ".$player->getId()." AND `key` = '".$value['storage']."' AND `value` = '".$value['value']."'")->fetch();
$status = ($quest) ? "true" : "false";
echo "<tr><td width='90%'><center>".$value['name']."</center></td><td width='90%'><center>".$value['value']."</center></tr>";
}
echo "</table>";
}
?>
jak to przerobic by zamiast value 1 pobieral value kazdej postaci
wiem jestem noobem nie umiem nic sam zrobic ale prosze was :>
 
spróbuj tego: i daj reputy za pomoc bo, żeby nie było, że seminari pomaga za freeee

Code:
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$characterPageQuests = array();
/* A list of quests for character/view page. It will be listed on the page as a table to show acomplished missions.
Array contains array of quests which includes STORAGE ID, STORAGE VALUE (Required to finish quest) and NAME 
To create new quest copy line accross and change values.
*/
$player = $GLOBALS['player'];
/* Eg. $characterPageQuests[] = array('storage'=>5000, 'value'=>1, 'name'=>'Demon Helmet Quest'); */
$characterPageQuests[] = array('storage'=>5000, 'value'=>1, 'name'=>'Reborn');


if(count($characterPageQuests) != 0) {
echo "<div class='bar'>Quests</div>";
echo "<table width='100%'>";
echo "<tr><td width='90%'><center><b>Quest Name</b></center></td><td><b><center>Reborn Level</center></b></td></tr>";
$SQL = POT::getInstance()->getDBHandle();
foreach($characterPageQuests as $value) {
$quest = $SQL->query("SELECT `value` FROM `player_storage` WHERE `player_id` = ".$player->getId()." AND `key` = '".$value['storage']."' AND `value` > '".$value['value']."'")->fetch();
$status = ($quest) ? "true" : "false";
echo "<tr><td width='90%'><center>".$value['name']."</center></td><td width='90%'><center>".$quest[0]."</center></tr>";
}
echo "</table>";
}
?>
 
Wielkie dzieki
sorry ale reputa nie moge ci dac bo juz kiedys ci go dawalem
 
Back
Top