• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Creaturescripts][PHP]Top Frags And second script only php

widnet

Banned User
Joined
Apr 11, 2009
Messages
920
Reaction score
3
Location
Poland/Cracow
Hello Otlanders
I write for u Top Frags Script
24pw7y1.png

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"/>
2.Create new file in data/creaturescripts/scripts/ dir ,Set file name topfrags.lua and paste to file this code

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
3.Open login.lua and paste after
Lua:
registerCreatureEvent(cid, "Mail")
this
Lua:
registerCreatureEvent(cid, "TopFrags")
Save file
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;
this

PHP:
        case "frags";
        $topic = "Top Frags";
        $subtopic = "frags";
        include("frags.php");
    break;
5.Go to phpmyadmin Select your OT DB,Select SQL
and paste this code
Code:
ALTER TABLE `players` ADD `frags` INT( 11 ) NOT NULL DEFAULT '0';
6.Create new file frags.php and paste this code
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>';
?>
Elf-Version
http://otland.net/f118/creaturescripts-php-top-frags-67566/index4.html#post699729
Rep ++ Please​
 
Last edited:
Evul....Now I need a new Unique Script for my coming Server, mine is more advanced but anyway it looks great. Keep your great job.
 
case "bugtracker";
$topic = "Bug Tracker";
$subtopic = "bugtracker";
include("bug.php");
break;

this isn't in index.php in nicaw svn19b

where does this go in my aac?
case "frags";
$topic = "Top Frags";
$subtopic = "frags";
include("frags.php");
break;
 
Back
Top