widnet
Banned User
Hello Otlanders
I write for u Top Frags Script
Live demo:
FunOT - Top Frags
Okay
Lets go...
1.Go to data/creaturescripts/ ,open creaturescripts.xml and add
2.Create new file in data/creaturescripts/scripts/ dir ,Set file name topfrags.lua and paste to file this code
3.Open login.lua and paste after
this
Save file
4.Go to /var/www or C:\xampp\httdocs\ open index.php and paste after
this
5.Go to phpmyadmin Select your OT DB,Select SQL
and paste this code
6.Create new file frags.php and paste this code
Elf-Version
http://otland.net/f118/creaturescripts-php-top-frags-67566/index4.html#post699729
Rep ++ Please
I write for u Top Frags Script
Live demo:
FunOT - Top Frags
Okay
Lets go...
1.Go to data/creaturescripts/ ,open creaturescripts.xml and add
Code:
<event type="kill" name="TopFrags" event="script" value="topfrags.lua"/>
Lua:
function onKill(cid, target, lastHit)
if isPlayer(target) then
db.executeQuery("UPDATE `players` SET `frags` = `frags` + 1 WHERE `id` = " .. getPlayerGUID(cid) .. ";")
end
return true
end
Lua:
registerCreatureEvent(cid, "Mail")
Lua:
registerCreatureEvent(cid, "TopFrags")
4.Go to /var/www or C:\xampp\httdocs\ open index.php and paste after
PHP:
case "bugtracker";
$topic = "Bug Tracker";
$subtopic = "bugtracker";
include("bug.php");
break;
PHP:
case "frags";
$topic = "Top Frags";
$subtopic = "frags";
include("frags.php");
break;
and paste this code
Code:
ALTER TABLE `players` ADD `frags` INT( 11 ) NOT NULL DEFAULT '0';
PHP:
<?PHP
$frags = $SQL->query('SELECT * FROM `players` ORDER BY `frags` DESC LIMIT 25;');
foreach($frags as $show) {
$noobs++;
if(is_int($noobs / 2))
$bgcolor = $config['site']['lightborder'];
else
$bgcolor = $config['site']['darkborder'];
$load .= '<TR BGCOLOR='.$bgcolor.'><TD><center><a href="?subtopic=characters&name='.urlencode($show['name']).'">'.$show['name'].'</a></center></TD><TD><center>'.$show['frags'].'</center></TD></TR>';
}
$main_content .= '<b><center>Top 25 Frags on '.$config['server']['serverName'].'</center></b><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b><center>Name</center></b></TD><TD class="white"><b><center>Frags</center></b></TD></TR>'.$load.'</TABLE>';
//Dont delate. Please respect my job :)
$main_content .= 'Script by <b><a href="http://otland.net/members/widnet/">widnet</a></b>';
?>
http://otland.net/f118/creaturescripts-php-top-frags-67566/index4.html#post699729
Rep ++ Please
Last edited: