и главное, что оно делает? зачем оно нужно?
This commit is contained in:
parent
afc15a384f
commit
da0aed9ffc
@ -1,19 +1,18 @@
|
|||||||
<?
|
<?php
|
||||||
|
|
||||||
class Quests {
|
class Quests
|
||||||
public $free_x = 28, $data = array(), $error = '';
|
{
|
||||||
|
public $free_x = 28, $data = [], $error = '';
|
||||||
|
|
||||||
public function testGood($pl, $uid) {
|
public function testGood($pl, $uid)
|
||||||
if(!is_array($pl)) {
|
{
|
||||||
$pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.$pl.'" LIMIT 1'));
|
if (!is_array($pl)) $pl = db::c()->query('SELECT * FROM `quests` WHERE `id` = ?i', $pl)->fetch_assoc();
|
||||||
}
|
|
||||||
|
|
||||||
$r = 1;
|
$r = 1;
|
||||||
|
|
||||||
$qlst = mysql_fetch_array(mysql_query('SELECT `id`, `vals` FROM `actions` WHERE `uid` = "'.$uid.'" AND `vars` = "start_quest'.$pl['id'].'" LIMIT 1'));
|
$qlst = db::c()->query('SELECT `vals` FROM `actions` WHERE `uid` = ?i AND `vars` = "?s"', $uid, 'start_quest'. $pl['id'])->fetch_assoc();
|
||||||
if(isset($qlst['id']) && $qlst['vals'] != 'win' && $qlst['vals'] != 'end' && $qlst['vals'] != 'bad') {
|
if (db::c()->getAffectedRows() AND !in_array($qlst['vals'],['win','end','vals'])) $r = 2;
|
||||||
$r = 2;
|
|
||||||
}
|
|
||||||
unset($qlst, $qlst2);
|
unset($qlst, $qlst2);
|
||||||
|
|
||||||
$d = $this->expl($pl['tr_date']);
|
$d = $this->expl($pl['tr_date']);
|
||||||
@ -66,75 +65,65 @@ class Quests {
|
|||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __clone() {
|
public function __clone()
|
||||||
|
{
|
||||||
trigger_error('Дублирование не допускается.', E_USER_ERROR);
|
trigger_error('Дублирование не допускается.', E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function startq($id, $val = NULL, $uid) {
|
public function startq($id, $uid)
|
||||||
$pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `delete` = "0" AND `id` = "'.mysql_real_escape_string($id).'" LIMIT 1'));
|
{
|
||||||
if(isset($pl['id'])) {
|
$pl = db::c()->query('SELECT `id`,`name`,`time` FROM `quests` WHERE `delete` = 0 AND `id` = ?i', $id)->fetch_assoc();
|
||||||
|
if (db::c()->getAffectedRows()) {
|
||||||
$tms = (time() + 60 * 60 * $pl['time']);
|
$tms = (time() + 60 * 60 * $pl['time']);
|
||||||
$this->addAction(time(), 'start_quest'.$pl['id'], 'go', $uid, $tms);
|
db::c()->query('INSERT INTO `actions` (`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val`) VALUES (?i,?i,"?s",?i,"?s","?s","?s","?s")',
|
||||||
$this->error = 'Вы успешно получили задание "'.$pl['name'].'"';
|
$uid, time(), 'capitalcity', 0, 'start_quest'. $id, $_SERVER['HTTP_X_REAL_IP'], 'go', $tms);
|
||||||
|
return 'Вы успешно получили задание "' . $pl['name'] . '"';
|
||||||
} else {
|
} else {
|
||||||
$this->error = 'Не удалось получить данное задание ...';
|
return 'Не удалось получить данное задание ...';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function list_quest($pl, $u) {
|
public function list_quest($pl, $u)
|
||||||
$r = ''; $t = ''; $nagr = ''; $tr = '';
|
{
|
||||||
$qlst = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u.'" AND `vars` = "start_quest'.$pl['id'].'" ORDER BY `time` DESC LIMIT 1'));
|
$r = '';
|
||||||
|
$t = '';
|
||||||
|
$nagr = '';
|
||||||
|
$tr = '';
|
||||||
|
$za = '';
|
||||||
|
|
||||||
|
$qlst = db::c()->query('SELECT `vals` FROM `actions` WHERE `uid` = ?i AND `vars` = "?s" ORDER BY `time` DESC', $u, 'start_quest'. $pl['id'])->fetch_assoc();
|
||||||
$ds = $this->expl($pl['win_date']);
|
$ds = $this->expl($pl['win_date']);
|
||||||
if(isset($ds['add_cr'])) {
|
if (isset($ds['add_cr'])) $nagr .= "Деньги: {$ds['add_cr']} кр. ";
|
||||||
$nagr .= 'Деньги : '.$ds['add_cr'].' кр. ';
|
if (isset($ds['add_point'])) $nagr .= "Репутация: {$ds['add_point']} ед. ";
|
||||||
}
|
if (isset($ds['add_exp'])) $nagr .= "Опыт: {$ds['add_exp']} ед. ";
|
||||||
if(isset($ds['add_point'])) {
|
|
||||||
$nagr .= ' Репутация : '.$ds['add_point'].' ед. ';
|
|
||||||
}
|
|
||||||
if(isset($ds['add_exp'])) {
|
|
||||||
$nagr .= ' Опыт : '.$ds['add_exp'].' ед. ';
|
|
||||||
}
|
|
||||||
|
|
||||||
$d = $this->expl($pl['act_date']);
|
$d = $this->expl($pl['act_date']);
|
||||||
if(isset($d['heal'])) {
|
|
||||||
$tr .= '<small>Вылечить <b>'.$d['heal'].'</b> игроков от травм.</small><br />';
|
if (isset($d['heal'])) $tr .= "<small>Вылечить <b>{$d['heal']}</b> игроков от травм.</small><br>";
|
||||||
}
|
if (isset($d['tr_win_haot'])) $tr .= "<small>Выиграть <b>{$d['tr_win_haot']}</b> хаотических поединков.</small><br>";
|
||||||
if(isset($d['tr_win_haot'])) {
|
if (isset($d['kill_clone'])) $tr .= "<small>Выиграть <b>{$d['kill_clone']}</b> поединков против своего клона.</small><br>";
|
||||||
$tr .= '<small>Выйграть <b>'.$d['tr_win_haot'].'</b> хаотических поединков.</small><br />';
|
if(isset($d['tr_win'])) $tr .= "<small>Выйграть <b>{$d['tr_win']}</b> физических поединков против игроков.</small><br>";
|
||||||
}
|
|
||||||
if(isset($d['kill_clone'])) {
|
|
||||||
$tr .= '<small>Выйграть <b>'.$d['kill_clone'].'</b> поединков против своего клона.</small><br />';
|
|
||||||
}
|
|
||||||
// if(isset($d['tr_win'])) {
|
|
||||||
// $tr .= '<small>Выйграть <b>'.$d['tr_win'].'</b> физических поединков против игроков.</small><br />';
|
|
||||||
// }
|
|
||||||
if (isset($d['kill_bot'])) {
|
if (isset($d['kill_bot'])) {
|
||||||
$x = '';
|
$x = '';
|
||||||
$ex = explode(',', $d['kill_bot']);
|
$ex = explode(',', $d['kill_bot']);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < count($ex)) {
|
while ($i < count($ex)) {
|
||||||
$ex2 = explode('=', $ex[$i]);
|
$ex2 = explode('=', $ex[$i]);
|
||||||
$bot2 = mysql_fetch_array(mysql_query('SELECT `id`, `login` FROM `users` WHERE `id` = "'.$ex2[0].'" LIMIT 1'));
|
$bot2 = db::c()->query('SELECT `login` FROM `users` WHERE `id` = ?i', $ex2[0])->fetch_assoc();
|
||||||
if(isset($bot2['id'])) {
|
if (db::c()->getAffectedRows()) $x .= " • <b>{$bot2['login']}</b> {$ex2[1]}<br>";
|
||||||
$x .= ' • <b>'.$bot2['login'].'</b> '.$ex2[1].'<br />';
|
|
||||||
}
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
if (!empty($x)) {
|
||||||
if($x != '') {
|
|
||||||
$x = trim($x, ', ');
|
$x = trim($x, ', ');
|
||||||
$tr .= '<small>Убить ботов: <br />'.$x.'</small>';
|
$tr .= "<small>Убить ботов: <br>{$x}</small>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($tr != '') {
|
if (!empty($tr)) $ts = 'Требования :<br />' . $tr;
|
||||||
$ts = 'Требования :<br />'.$tr;
|
|
||||||
}
|
|
||||||
|
|
||||||
$za = '';
|
|
||||||
if ($qlst['time'] + ($pl['heal'] * 60 * 60) - time() > 0) {
|
if ($qlst['time'] + ($pl['heal'] * 60 * 60) - time() > 0) {
|
||||||
$tms = $this->timeOut($qlst['time'] + ($pl['heal'] * 60 * 60) - time());
|
$tms = $this->timeOut($qlst['time'] + ($pl['heal'] * 60 * 60) - time());
|
||||||
$za = '<b style=\'color: Red;\'>Задержка еще : '.$tms.'</b><br />';
|
$za = "<b style='color: Red;'>Задержка еще: {$tms}</b><br />";
|
||||||
}
|
}
|
||||||
|
|
||||||
$d = $this->expl($pl['tr_date']);
|
$d = $this->expl($pl['tr_date']);
|
||||||
@ -161,8 +150,10 @@ class Quests {
|
|||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function info($pl, $uid) {
|
public function info($pl, $uid)
|
||||||
$r = ''; $t = '';
|
{
|
||||||
|
$r = '';
|
||||||
|
$t = '';
|
||||||
$qst = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $uid . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` = "go" LIMIT 1'));
|
$qst = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $uid . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` = "go" LIMIT 1'));
|
||||||
$d = $this->expl($pl['tr_date']);
|
$d = $this->expl($pl['tr_date']);
|
||||||
|
|
||||||
@ -357,7 +348,8 @@ class Quests {
|
|||||||
|
|
||||||
if (isset($d['tk_itm'])) {
|
if (isset($d['tk_itm'])) {
|
||||||
$ex = explode(',', $d['tk_itm']);
|
$ex = explode(',', $d['tk_itm']);
|
||||||
$i = 0; $x = '';
|
$i = 0;
|
||||||
|
$x = '';
|
||||||
while ($i < count($ex)) {
|
while ($i < count($ex)) {
|
||||||
$ex2 = explode('=', $ex[$i]);
|
$ex2 = explode('=', $ex[$i]);
|
||||||
$x2 = mysql_fetch_array(mysql_query('SELECT `koll` FROM `inventory` WHERE `prototype` = "' . mysql_real_escape_string($ex2[0]) . '" AND `owner` = "' . $uid . '" LIMIT 1'));
|
$x2 = mysql_fetch_array(mysql_query('SELECT `koll` FROM `inventory` WHERE `prototype` = "' . mysql_real_escape_string($ex2[0]) . '" AND `owner` = "' . $uid . '" LIMIT 1'));
|
||||||
@ -406,7 +398,8 @@ class Quests {
|
|||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function endq($id, $tp, $user) {
|
public function endq($id, $tp, $user)
|
||||||
|
{
|
||||||
$pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `delete` = "0" AND `min_lvl` <= "' . $user['level'] . '" AND `max_lvl` >= "' . $user['level'] . '" AND `id` = "' . mysql_real_escape_string($id) . '" LIMIT 1'));
|
$pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `delete` = "0" AND `min_lvl` <= "' . $user['level'] . '" AND `max_lvl` >= "' . $user['level'] . '" AND `id` = "' . mysql_real_escape_string($id) . '" LIMIT 1'));
|
||||||
$qlst = mysql_fetch_array(mysql_query('SELECT `id` FROM `actions` WHERE `uid` = "' . $user['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` = "go" LIMIT 1'));
|
$qlst = mysql_fetch_array(mysql_query('SELECT `id` FROM `actions` WHERE `uid` = "' . $user['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` = "go" LIMIT 1'));
|
||||||
if (isset($qlst['id'])) {
|
if (isset($qlst['id'])) {
|
||||||
@ -421,7 +414,8 @@ class Quests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAction($filter, $tp) {
|
public function testAction($filter, $tp)
|
||||||
|
{
|
||||||
if ($tp == 1) {
|
if ($tp == 1) {
|
||||||
$ins = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val` FROM `actions` WHERE ' . $filter . ''));
|
$ins = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val` FROM `actions` WHERE ' . $filter . ''));
|
||||||
} elseif ($tp == 2) {
|
} elseif ($tp == 2) {
|
||||||
@ -430,32 +424,41 @@ class Quests {
|
|||||||
return $ins;
|
return $ins;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function timeOut($ttm) {
|
public function timeOut($ttm)
|
||||||
|
{
|
||||||
$out = '';
|
$out = '';
|
||||||
$time_still = $ttm;
|
$time_still = $ttm;
|
||||||
$tmp = floor($time_still / 2592000);
|
$tmp = floor($time_still / 2592000);
|
||||||
$id = 0;
|
$id = 0;
|
||||||
if ($tmp > 0) {
|
if ($tmp > 0) {
|
||||||
$id++;
|
$id++;
|
||||||
if($id < 3) { $out .= $tmp." мес. "; }
|
if ($id < 3) {
|
||||||
|
$out .= $tmp . " мес. ";
|
||||||
|
}
|
||||||
$time_still = $time_still - $tmp * 2592000;
|
$time_still = $time_still - $tmp * 2592000;
|
||||||
}
|
}
|
||||||
$tmp = floor($time_still / 86400);
|
$tmp = floor($time_still / 86400);
|
||||||
if ($tmp > 0) {
|
if ($tmp > 0) {
|
||||||
$id++;
|
$id++;
|
||||||
if($id < 3) { $out .= $tmp." дн. "; }
|
if ($id < 3) {
|
||||||
|
$out .= $tmp . " дн. ";
|
||||||
|
}
|
||||||
$time_still = $time_still - $tmp * 86400;
|
$time_still = $time_still - $tmp * 86400;
|
||||||
}
|
}
|
||||||
$tmp = floor($time_still / 3600);
|
$tmp = floor($time_still / 3600);
|
||||||
if ($tmp > 0) {
|
if ($tmp > 0) {
|
||||||
$id++;
|
$id++;
|
||||||
if($id < 3) { $out .= $tmp." ч. "; }
|
if ($id < 3) {
|
||||||
|
$out .= $tmp . " ч. ";
|
||||||
|
}
|
||||||
$time_still = $time_still - $tmp * 3600;
|
$time_still = $time_still - $tmp * 3600;
|
||||||
}
|
}
|
||||||
$tmp = floor($time_still / 60);
|
$tmp = floor($time_still / 60);
|
||||||
if ($tmp > 0) {
|
if ($tmp > 0) {
|
||||||
$id++;
|
$id++;
|
||||||
if($id < 3) { $out .= $tmp." мин. "; }
|
if ($id < 3) {
|
||||||
|
$out .= $tmp . " мин. ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($out == '') {
|
if ($out == '') {
|
||||||
if ($time_still < 0) {
|
if ($time_still < 0) {
|
||||||
@ -466,16 +469,10 @@ class Quests {
|
|||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addAction($time, $vars, $vls, $uid, $val) {
|
|
||||||
$ins = mysql_query('INSERT INTO `actions` (`uid`, `time`, `city`, `room`, `vars`, `ip`, `vals`, `val`) VALUES ("'.$uid.'", "'.$time.'", "capitalcity", "0", "'.mysql_real_escape_string($vars).'", "'.mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']).'", "'.mysql_real_escape_string($vls).'", "'.$val.'")');
|
|
||||||
if($ins) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function expl($d) {
|
|
||||||
|
public function expl($d)
|
||||||
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$e = explode(':|:', $d);
|
$e = explode(':|:', $d);
|
||||||
while ($i < count($e)) {
|
while ($i < count($e)) {
|
||||||
@ -489,7 +486,8 @@ class Quests {
|
|||||||
return $dr;
|
return $dr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function winqst($id, $user) {
|
public function winqst($id, $user)
|
||||||
|
{
|
||||||
$bad = 0;
|
$bad = 0;
|
||||||
$qlst = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $user['id'] . '" AND `vars` = "start_quest' . $id . '" AND `vals` = "go" LIMIT 1'));
|
$qlst = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $user['id'] . '" AND `vars` = "start_quest' . $id . '" AND `vals` = "go" LIMIT 1'));
|
||||||
$qu = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . $id . '" LIMIT 1'));
|
$qu = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . $id . '" LIMIT 1'));
|
||||||
@ -499,28 +497,36 @@ class Quests {
|
|||||||
if (isset($d['heal'])) {
|
if (isset($d['heal'])) {
|
||||||
$x = $this->testAction('`uid` = "' . $user['id'] . '" AND `time` > "' . $qlst['time'] . '" AND `vars` LIKE "heal%" AND `vars` != "heal_' . $user['id'] . '" LIMIT 1', 2);
|
$x = $this->testAction('`uid` = "' . $user['id'] . '" AND `time` > "' . $qlst['time'] . '" AND `vars` LIKE "heal%" AND `vars` != "heal_' . $user['id'] . '" LIMIT 1', 2);
|
||||||
$x = ($x[0] + 0);
|
$x = ($x[0] + 0);
|
||||||
if($x < $d['heal']) { $bad = 1; }
|
if ($x < $d['heal']) {
|
||||||
|
$bad = 1;
|
||||||
|
}
|
||||||
unset($x);
|
unset($x);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($d['tr_win'])) {
|
if (isset($d['tr_win'])) {
|
||||||
$x = $this->testAction('`uid` = "' . $user['id'] . '" AND `time` > "' . $qlst['time'] . '" AND `vars` = "win_fiz" LIMIT 1', 2);
|
$x = $this->testAction('`uid` = "' . $user['id'] . '" AND `time` > "' . $qlst['time'] . '" AND `vars` = "win_fiz" LIMIT 1', 2);
|
||||||
$x = (0 + $x[0]);
|
$x = (0 + $x[0]);
|
||||||
if($x < $d['tr_win']) { $bad = 1; }
|
if ($x < $d['tr_win']) {
|
||||||
|
$bad = 1;
|
||||||
|
}
|
||||||
unset($x);
|
unset($x);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($d['kill_clone'])) {
|
if (isset($d['kill_clone'])) {
|
||||||
$x = $this->testAction('`uid` = "' . $user['id'] . '" AND `time` > "' . $qlst['time'] . '" AND `vars` = "kill_clone" LIMIT 1', 2);
|
$x = $this->testAction('`uid` = "' . $user['id'] . '" AND `time` > "' . $qlst['time'] . '" AND `vars` = "kill_clone" LIMIT 1', 2);
|
||||||
$x = (0 + $x[0]);
|
$x = (0 + $x[0]);
|
||||||
if($x < $d['kill_clone']) { $bad = 1; }
|
if ($x < $d['kill_clone']) {
|
||||||
|
$bad = 1;
|
||||||
|
}
|
||||||
unset($x);
|
unset($x);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($d['tr_win_haot'])) {
|
if (isset($d['tr_win_haot'])) {
|
||||||
$x = $this->testAction('`uid` = "' . $user['id'] . '" AND `time` > "' . $qlst['time'] . '" AND `vars` = "win_haot" LIMIT 1', 2);
|
$x = $this->testAction('`uid` = "' . $user['id'] . '" AND `time` > "' . $qlst['time'] . '" AND `vars` = "win_haot" LIMIT 1', 2);
|
||||||
$x = (0 + $x[0]);
|
$x = (0 + $x[0]);
|
||||||
if($x < $d['tr_win_haot']) { $bad = 1; }
|
if ($x < $d['tr_win_haot']) {
|
||||||
|
$bad = 1;
|
||||||
|
}
|
||||||
unset($x);
|
unset($x);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -539,7 +545,9 @@ class Quests {
|
|||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
if($x < $ex2[1]) { $bad = 1; }
|
if ($x < $ex2[1]) {
|
||||||
|
$bad = 1;
|
||||||
|
}
|
||||||
unset($x);
|
unset($x);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -547,7 +555,8 @@ class Quests {
|
|||||||
$nagr = $this->expl($qu['win_date']);
|
$nagr = $this->expl($qu['win_date']);
|
||||||
mysql_query('UPDATE `actions` SET `vals` = "win" WHERE `uid` = "' . $user['id'] . '" AND `vars` = "start_quest' . $id . '" LIMIT 1');
|
mysql_query('UPDATE `actions` SET `vals` = "win" WHERE `uid` = "' . $user['id'] . '" AND `vars` = "start_quest' . $id . '" LIMIT 1');
|
||||||
if (isset($nagr['add_cr'])) {
|
if (isset($nagr['add_cr'])) {
|
||||||
$user['money'] += $nagr['add_cr']; $c .= $nagr['add_cr'].' кр. ';
|
$user['money'] += $nagr['add_cr'];
|
||||||
|
$c .= $nagr['add_cr'] . ' кр. ';
|
||||||
}
|
}
|
||||||
if (isset($nagr['add_point'])) {
|
if (isset($nagr['add_point'])) {
|
||||||
$user['doblest'] += $nagr['add_point'];
|
$user['doblest'] += $nagr['add_point'];
|
||||||
@ -577,7 +586,8 @@ class Quests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function msg($text, $who, $room) {
|
public function msg($text, $who, $room)
|
||||||
|
{
|
||||||
$fp = fopen("/tmp/chat.txt", "a");
|
$fp = fopen("/tmp/chat.txt", "a");
|
||||||
flock($fp, LOCK_EX);
|
flock($fp, LOCK_EX);
|
||||||
fputs($fp, ":[" . time() . "]:[{$who}]:[" . ($text) . "]:[" . $room . "]\r\n");
|
fputs($fp, ":[" . time() . "]:[{$who}]:[" . ($text) . "]:[" . $room . "]\r\n");
|
||||||
|
@ -21,7 +21,7 @@ if ($get == 'hps') {
|
|||||||
if (isset($_GET['quid'])) {
|
if (isset($_GET['quid'])) {
|
||||||
$pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `delete` = "0" AND `min_lvl` <= "' . $user['level'] . '" AND `max_lvl` >= "' . $user['level'] . '" AND `id` = "' . mysql_real_escape_string($_GET['quid']) . '" LIMIT 1'));
|
$pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `delete` = "0" AND `min_lvl` <= "' . $user['level'] . '" AND `max_lvl` >= "' . $user['level'] . '" AND `id` = "' . mysql_real_escape_string($_GET['quid']) . '" LIMIT 1'));
|
||||||
if (isset($pl['id']) && $q->testGood($pl, $user['id']) == 1) {
|
if (isset($pl['id']) && $q->testGood($pl, $user['id']) == 1) {
|
||||||
echo $q->startq($pl['id'], null, $user['id']);
|
echo $q->startq($pl['id'], $user['id']);
|
||||||
} elseif ($q->testGood($pl, $user['id']) == 2) {
|
} elseif ($q->testGood($pl, $user['id']) == 2) {
|
||||||
$status = 'У вас уже есть такое задание ...';
|
$status = 'У вас уже есть такое задание ...';
|
||||||
} elseif ($q->testGood($pl, $user['id']) == 3) {
|
} elseif ($q->testGood($pl, $user['id']) == 3) {
|
||||||
|
Loading…
Reference in New Issue
Block a user