DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • November 12, 2018, 10:58:31 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Listing everybody on a PvP fight.  (Read 2911 times)
0 Members and 1 Guest are viewing this topic.
Odyssey
Guest
« on: June 12, 2004, 06:28:52 PM »

I decided to mod the code a bit, because I was getting Petitions from players that were wondering if this feature worked.

With all the statements that had to be true (expecially the level check), most of them kept on getting an empty list.

So, I went on with this, since this is the way the original LORD was set up.  You get the list of everybody who:
 - is alive
 - past the 3 day immunity
 - in the fields
However, included in that list is the opponient's experience.

It's up to the play to decide if they want to try and attack them.  


This is after: $exp = getsetting("pvpminexp", 1500);
and before: }
   }
   output("</table>",true);
   addnav("List Warriors","pvp.php?op=list");


Code:
$sql = "SELECT name,alive,location,sex,level,experience,laston,loggedin,login,pvpflag FROM accounts WHERE
   (locked=0) AND
   (npc=0) AND
   (age > $days OR dragonkills > 0 OR pk > 0 OR experience > $exp) AND
   (alive=1 AND location=0) AND
   (laston < '".date("Y-m-d H:i:s",strtotime("-".getsetting("LOGINTIMEOUT",900)." sec"))."' OR loggedin=0) AND
   (acctid <> ".$session[user][acctid].")
   ORDER BY level DESC";
   //after age  - (level >= ".($session[user][level]-1)." AND level <= ".($session[user][level]+2).") AND
   //echo ("<pre>$sql</pre>");
  $result = db_query($sql) or die(db_error(LINK));
   output("<table border='0' cellpadding='3' cellspacing='3'><tr><td>Name</td><td>Level</td><td>Exp.</td><td>Ops.</td></tr>",true);
   for ($i=0;$i<db_num_rows($result);$i++){
     $row = db_fetch_assoc($result);
     $biolink="bio.php?char=".rawurlencode($row[login])."&ret=".urlencode($_SERVER['REQUEST_URI']);
     addnav("", $biolink);
      if($row[pvpflag]>$pvptimeout){
        output("<tr class='".($i%2?"trlight":"trdark")."'><td>$row[name]</td><td>$row[level]</td><td>$row[experience]</td><td>[ <a href='$biolink'>Bio</a> | `i(Attacked too recently)`i ]</td></tr>",true);
      }else{
        output("<tr class='".($i%2?"trlight":"trdark")."'><td>$row[name]</td><td>$row[level]</td><td>$row[experience]</td><td>[ <a href='$biolink'>Bio</a> | <a href='pvp.php?act=attack&name=".rawurlencode($row[login])."'>Attack</a> ]</td></tr>",true);
         addnav("","pvp.php?act=attack&name=".rawurlencode($row[login]));


It was a very quick mod, so if anybody can make it better or spruce it up a little, feel free to do so.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
38 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search