• 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!

[Gesior ACC] Already training (Offline Training).

Potar

SocialWorld
Senator
Joined
Mar 1, 2009
Messages
1,664
Reaction score
125
Location
Warsaw, Poland
Hello i want to show you the simple code, when you can check how many player are training and which type they are training.

This is very simple but usefull :)

offline.php

PHP:
<?PHP
    $i = 0;

    $main_content .= '<h2>Already Training on Denera World!</h2><TABLE border=0 CELLSPACING=1 CELLPADDING=2 WIDTH=100%class="table table-striped"><TR><TD CLASS=white COLSPAN=4>';
	$n = $SQL->query('SELECT COUNT(`offlinetraining_skill`) as `count` FROM `players` WHERE `offlinetraining_skill` > 0;')->fetch();
        $main_content .= '<div class="alert alert-success">There are '.$n['count'].' players already training on our world!</div></TD></TR><TR><TD WIDTH=30%><B>Name</B></TD><TD WIDTH="10%"><B>Level</B></TD><TD WIDTH="20%"><B>Vocation</B></TD><TD WIDTH="50%"><center><B>Training Type</B></center></TD></TR>';
        $list = $SQL->query('SELECT `name`, `level`, `vocation`, `promotion`, `offlinetraining_skill` FROM `players` WHERE `offlinetraining_skill` > 0;')->fetchAll();
        foreach($list as $player) {
            $i++;
            $main_content.= '<TR><TD WIDTH=30%><A HREF="?subtopic=characters&name='.urlencode($player['name']).'">'.$player['name'].'</A></TD><TD WIDTH=10%>'.$player['level'].'</TD><TD WIDTH=20%>'.$vocation_name[0][$player['promotion']][$player['vocation']].'</TD><TD WIDTH=50%><center>'.$skill_name[0][$player['offlinetraining_skill']].'</center></TD></TR>';
        }

    $main_content .= '</TABLE></td></tr></table>';
?>

config/config.php
PHP:
$skill_name[0] = array(1 => 'Club + Shielding',2 => 'Sword + Shielding',3 => 'Axe + Shielding',4 => 'Distance + Shielding',7 => 'Magic + Shielding');

index.php
PHP:
 	case "offline";
  	        $topic = "Already Training";
 	        $subtopic = "offline";
 	        include("offline.php");
	break;

Remember that works if you have offline training on your server :)

Rep will be nice :)

Have fun !
 
hello, there is some script for the server status,
type: training players: 290???
rep +
 
hello, there is some script for the server status,
type: training players: 290???
rep +

PHP:
<?PHP
    $a = $SQL->query('SELECT COUNT(`offlinetraining_skill`) FROM `players` WHERE `offlinetraining_skill` > 0')->fetch();
    echo 'Players training already: '.$a[0];
?>
 
Back
Top