DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • July 20, 2019, 06:06:37 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Resource Pages

Pages: [1]   Go Down
Author Topic: Listing everybody on a PvP fight.  (Read 3167 times)
0 Members and 1 Guest are viewing this topic.
« 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: }
   addnav("List Warriors","pvp.php?op=list");

$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);
     addnav("", $biolink);
        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);
        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);

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

DragonPrime Notices
Please take the time to read the FAQ and browse the DragonPedia

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