![]() |
|
|
#1 |
|
Архивный участник
Join Date: Jan 2006
Posts: 125
|
Anyone has a script out there so you can show the top players as for pvp, adena, level, experience and similar for L2OFF? I'm sorry, did a search and found nothing. If it's not permitted, just remove my thread.
Thanks & Regards. |
|
|
|
|
#2 |
|
Архивный участник
Join Date: Sep 2005
Posts: 1,014
|
a single query..
for example... TOP 10 EXP ------------- SELECT TOP 10 char_name,exp FROM user_data WHERE builder = 0 AND account_id > 0 ORDER by 2 DESC ------------ "builder = 0" hideGMs from list... "account_id > 0" is to hide deleted/banned players from list... you can change this query for others things... for pvp ? ------------ SELECT TOP 10 char_name,duel FROM user_data WHERE builder = 0 AND account_id > 0 ORDER by 2 DESC ------------ ... and if you want to know the TOP 100 more rich... something like this... ------------ SELECT TOP 10 char_name as Player,SUM(amount) as Adena FROM user_data,user_item WHERE user_data.char_id = user_item.char_id AND item_type = 57 AND builder = 0 AND warehouse BETWEEN 0 AND 1 GROUP by char_name ORDER by 2 DESC ------------ Online players ? ------------------- SELECT TOP 1 world_user FROM lin2db.dbo.user_count WHERE (record_time = (SELECT MAX(record_time) FROM lin2db.dbo.user_count)) Alliances info --------------- SELECT pledge.name as Clan,char_name as Lider,alliance.name as Alianza FROM pledge,user_data,alliance WHERE user_data.char_id = pledge.ruler_id AND pledge.alliance_id = alliance.id AND builder = 0 ORDER by alliance_id ---------------- maybe people who knows a lot of SQL think this querys are very bad, but.. i only learn SQL to use in L2OFF... reading manuals and see examples... i wait help you... i can't share geodatas or others things.. but i can help you with this. :P user this in ASP or PHP, is very simple, if you need an example to use this in PHP only ask me. |
|
|
|
|
#3 |
|
Архивный участник
Join Date: Oct 2005
Posts: 99
|
/spanish! Fidow comparte algun PhP aunque sea orientativo, porque no tengo ni idea :S !spanish\
|
|
|
|
|
#4 |
|
Архивный участник
Join Date: May 2005
Posts: 463
|
"spanish" si es posible seria genial que hicieras eso fidow... en realidad con tanto hex ni siquiera e mirado el php... "spanish"
|
|
|
|
|
#5 |
|
Архивный участник
Join Date: Jan 2006
Posts: 125
|
Podrias darme un ejemplo de PHP?
Could you give me an example in PHP? Gracias Thank you |
|
|
|
|
#6 |
|
Архивный участник
Join Date: Sep 2005
Posts: 1,014
|
ok, aqui tienen, tampoco soy experto en PHP pero aprendo sobre la marcha cuando necesito algo, la verdad es bastante sencillo y la sintaxis es igualita a C++
Con esto mostramos por ejemplo el TOP 10 por nivel... lo ordeno por exp dado que en el caso de ser de mismo nivel... no los ordenaria correctamente, esto se solventa con ORDER by exp Un saludo y espero les sirva. El codigo lo he hecho pensando en que les sirva para cualquier consulta que hagan. PD: Conteste en español ya que parece que todos los interesados lo son xD [php:1:72d6ff2e71] <? $ip="127.0.0.1"; //Aqui la IP de tu server $user="sa"; //Aqui el user de MS SQL $pass="default"; //Aqui el password de MS SQL $db="lin2world"; // Nombre de la base de datos que estamos consultando $nombrelista="TOP 10 PLAYERS"; // Nombre que daremos a los datos que aparecen $colortabla1="#AAAAAA"; // Color de la primera fila $colortabla2="#CCCCCC"; // Color del resto de filas $anchotabla="150"; // Ancho de la tabla // La consulta que quieren hacer a la base de datos $query="SELECT TOP 10 char_name as Player,lev as LVL FROM user_data "; $query="$query WHERE account_id > 0 AND builder = 0 "; $query="$query ORDER by exp DESC "; // A partir de aqui no necesitan tocar nada... // ------------------------------------------- $conn=mssql_connect($ip,$user,$pass); mssql_select_db($db, $conn); $resultado = mssql_query($query); echo "$nombrelista"; echo "<table width='$anchotabla'>"; echo "<tr bgcolor='$colortabla1'>"; $i=0; while (mssql_num_fields($resultado)>$i) { $campo=mssql_field_name($resultado, $i); echo "<td>$campo</td>"; $i++; } echo "</tr>"; $i=0; while (mssql_num_rows($resultado)>$i) { $j=0; echo "<tr bgcolor='$colortabla2'>"; while (mssql_num_fields($resultado)>$j ) { $data=mssql_result($resultado, $i, $j); echo "<td>$data</td>"; $j++; } echo "</tr>"; $i++; } echo "</table>"; $conn=mssql_close(); ?> [/php:1:72d6ff2e71] |
|
|
|
|
#7 |
|
Архивный участник
Join Date: Oct 2005
Posts: 99
|
Muchas gracias FidoW, ahora mirare de hacer con clanes, allis, dinero, etc etc...
Cash pa ti^^ |
|
|
|
|
#8 |
|
Архивный участник
Join Date: May 2005
Posts: 463
|
gracias fidows, te pasaste,
no tienes algunas otras cosas, como el clan, o algun mapa que muestre la ubicacion, te lo pido porque todo lo otro esta explicado en ingles, y sincermanete el google traduce muy, pero muy mal derrepente :P.. a y cash for you thanks
|
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|