Hi,
I change a little the script and now we can pvp, sombebody want the script?
| Welcome | |
|---|---|
| Welcome to the Official<strong>World of Phaos</strong>Forums.
You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining the World of Phaos community for free, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join the World of Phaos community today</a>! |
|
if (!count($list)) {if (!count($list) && !isset($_GET['attaquer']) && $_SESSION['attaquePlayer'] == 0) { if(!@$_SESSION['opponent_id']){
$_SESSION['opponent_id']= $list[0];
} if(!@$_SESSION['opponent_id']){
if(isset($_GET['attaquer']))
{
$_SESSION['attaquePlayer'] = $_GET['attaquer'];
$list[0]=$_GET['attaquer'];
}
else
$_SESSION['opponent_id']= $list[0];
}
if($_SESSION['attaquePlayer'] == $_SESSION['opponent_id'])
$list[0] = $_SESSION['opponent_id']; function kill_characterid(){
$query = "DELETE FROM phaos_characters WHERE id = '".$this->id."'";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
// FIXME: DBS - this should be changed so items are dropped at location
$query = "DELETE FROM phaos_char_inventory WHERE username = '".$this->user."'";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
return 1;
}function kill_characterid(){
if($this->user == "phaos_npc")
{
$query = "DELETE FROM phaos_characters WHERE id = '".$this->id."'";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
// FIXME: DBS - this should be changed so items are dropped at location
$query = "DELETE FROM phaos_char_inventory WHERE username = '".$this->user."'";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
return 1;
}
else // when dead, go to Gornath (easy city of undead) to start over
{
$query = "UPDATE phaos_characters set location='4072' WHERE id = '".$this->id."'";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
}
return 1;
}<tr>
<td align="left">
<br><br>
<b><? echo $lang_town["ot_on"]; ?></b><br>
<? echo who_is_online($char_loc) ?>
<br><br>
<b><? echo $lang_town["ot_of"]?></b><br>
<? echo who_is_offline($char_loc) ?>
</td>
</tr><tr>
<td align="left">
<br><br>
<b><? echo $lang_town["ot_on"]; ?></b><br>
<? echo who_is_online($char_loc,true) ?>
<br><br>
<b><? echo $lang_town["ot_of"]?></b><br>
<? echo who_is_offline($char_loc,true) ?>
</td>
</tr>function who_is_online($location = '') {
global $PHP_PHAOS_USER;
global $lang_glo;
if ($location != '') { $loc = 'location = ' . $location . ' AND '; }
$current_time = time();
$active_min = $current_time-300;
$active_max = $current_time+300;
$result = mysql_query("SELECT * FROM phaos_characters WHERE $loc regen_time >= '$active_min' AND regen_time <= '$active_max' AND username != 'phaos_npc' AND username != 'phaos_npc_arena' ORDER by name ASC");
$html='';
if (mysql_num_rows($result) != 0) {
while ($row = mysql_fetch_assoc($result)) {
$html .= '<font color="#009900">|</font><a href="player_info.php?player_name='. $row['username'] . '" target="_blank">' . $row['name'] . '</a>';
}
} else {
$html = "<font color=#009900>|</font>".$lang_glo["n_else"];
}
return $html . '<font color="#009900">|</font>';
}
function who_is_offline($location = '') {
global $PHP_PHAOS_USER;
if ($location != '') { $loc = 'location = ' . $location . ' AND '; }
$current_time = time();
$active_min = $current_time-300;
$active_max = $current_time+300;
$result = mysql_query("SELECT * FROM phaos_characters WHERE $loc regen_time < '$active_min' AND username != 'phaos_npc%' AND username != 'phaos_npc_arena' ORDER by name ASC");
echo mysql_error();
$html='';
if (mysql_num_rows($result) != 0) {
while ($row = mysql_fetch_assoc($result)) {
$html = '<font color="#009900">|</font><a href="player_info.php?player_name='. $row['username'] . '" target="_blank" style="color=#FFFFFF">' . $row['name'] . '</a>';
}
}
return $html . '<font color="#009900">|</font>';
}function who_is_online($location = '',$attack = false) {
global $PHP_PHAOS_USER;
global $lang_glo;
if ($location != '') { $loc = 'location = ' . $location . ' AND '; }
$current_time = time();
$active_min = $current_time-300;
$active_max = $current_time+300;
$result = mysql_query("SELECT * FROM phaos_characters WHERE $loc regen_time >= '$active_min' AND regen_time <= '$active_max' AND username != 'phaos_npc' AND username != 'phaos_npc_arena' ORDER by name ASC");
$html='';
if (mysql_num_rows($result) != 0) {
while ($row = mysql_fetch_assoc($result)) {
$html .= '<font color="#009900">|</font><a href="player_info.php?player_name='. $row['username'] . '" target="_blank">' . $row['name'] . '</a>';
if($attack) $html .= ' (<a href="combat.php?attaquer='. $row['id'] . '">Attaquer</a>)';
}
} else {
$html = "<font color=#009900>|</font>".$lang_glo["n_else"];
}
return $html . '<font color="#009900">|</font>';
}
function who_is_offline($location = '',$attack = false) {
global $PHP_PHAOS_USER;
if ($location != '') { $loc = 'location = ' . $location . ' AND '; }
$current_time = time();
$active_min = $current_time-300;
$active_max = $current_time+300;
$result = mysql_query("SELECT * FROM phaos_characters WHERE $loc regen_time < '$active_min' AND username != 'phaos_npc%' AND username != 'phaos_npc_arena' ORDER by name ASC");
echo mysql_error();
$html='';
if (mysql_num_rows($result) != 0) {
while ($row = mysql_fetch_assoc($result)) {
$html = '<font color="#009900">|</font><a href="player_info.php?player_name='. $row['username'] . '" target="_blank" style="color=#FFFFFF">' . $row['name'] . '</a>';
if($attack) $html.= ' (<a href="combat.php?attaquer='. $row['id'] . '">Attaquer</a>)';
}
}
return $html . '<font color="#009900">|</font>';
}Rebell wrote:Hello,
can you post or upload your scritp ?
CYA
Rebell wrote:Please post your website
This is a great script! Only problem is that players can fight themselves and earn gold + exp off themselves, thus cheating the system. I tried altering it/adding code in to exempt you from seeing/fighting yourself but failed. If someone can post some code that eliminates you from seeing yourself in town.php or pervent you from fighting yourself in combat/php that would be greatly appreciated.
if($attack) if($attack && $GLOBALS['PHP_PHAOS_CHARID'] != $row['id'] ) if(isset($_GET['attaquer']))
{
$_SESSION['attaquePlayer'] = $_GET['attaquer'];
$list[0]=$_GET['attaquer'];
} if(isset($_GET['attaquer']) && $GLOBALS['PHP_PHAOS_CHARID'] != $row['id'])
{
//FIXME: Serucity holl, we need to check if player location = opponent location
//Player location $character->location
$_SESSION['attaquePlayer'] = $_GET['attaquer'];
$list[0]=$_GET['attaquer'];
}Users browsing this forum: No registered users and 0 guests