• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

GameMaster On/off php script

Mythic Archon
Loyal Member
Joined
Oct 31, 2007
Messages
762
Reaction score
14
Hi all.

I have seen alot looking for this script. So now i will release it.

IT IS NOT MY OWN CREATION!

Unfortunately, i cant remember where i got it from, so i cant add credits.
Though alot webs got it already.

But here it is.

PHP:
<?
include("config.php");
$query=mssql_query("SELECT * FROM Character WHERE CtlCode=32");
while($gm=mssql_fetch_array($query)){
$stat="";
$gmname=$gm['Name'];
$gmacc=$gm['AccountID'];
$query2=mssql_query("SELECT ConnectStat FROM MEMB_STAT WHERE memb___id='$gmacc'");
$query3=mssql_query("SELECT GameIDC FROM AccountCharacter WHERE Id='$gmacc'");
$query3=mssql_result($query3, 0, 0);
$rquery2=mssql_num_rows($query2);
if($rquery2<1) { $query2 = '0'; }
else{ $query2=mssql_result($query2, 0, 0); }
if($query2=='1'){ 
if($query3==$gmname){ 
$stat =  '<font color=green><strong>[ON]</strong></font>';
 } 
}
if($query2=='0'){
  $stat =  '<font color=red><strong>[OFF]</strong></font>';
 }
if($query2=='1' AND $query3 <> $gmname){ 
 $stat =  '<font color=red><strong>[OFF]</strong></font>';
 }
      echo "$gmname $stat";
      echo "<br>";
}
?>

If you want to add another table with the Invisible gm's, insert came code but change:

PHP:
$query=mssql_query("SELECT * FROM Character WHERE CtlCode=32");

WITH:

PHP:
$query=mssql_query("SELECT * FROM Character WHERE CtlCode=8");

If you got questions or need help to get it into your site, PM me.
 
Newbie Spellweaver
Joined
Nov 18, 2004
Messages
56
Reaction score
0
Re: [Release]GameMaster On/off php script

09/10
 
Newbie Spellweaver
Joined
Aug 31, 2006
Messages
17
Reaction score
0
Re: [Release]GameMaster On/off php script

this code is very complicated, is big largest
why you use two echo ?
PHP:
echo("$gm['Name'] $stat<br>");
i'm posting my little code here

PHP:
<table width="300" border="0" align="center" cellpadding="2" cellspacing="0">
  <tr>
    <td>Nome</td>
    <td>Status</td>
  </tr>
  <?
  include ("config.php");
  $query = mssql_query("select * from character WHERE CtlCode>='8'");
  $pega_gms = mssql_fetch_array($query);
  for($i=0;$i< mssql_num_rows($query);$i++) {
  $status_stat = mssql_result(mssql_query("SELECT ConnectStat FROM MEMB_STAT WHERE memb___id='$pega_gms[AccountID]'"), 0, 0);
  $pega_account = mssql_num_rows(mssql_query("select GameIDC from AccountCharacter WHERE GameIDC='$pega_gms[AccountID]'"));
  if(($status_stat == '1') || ($pega_account >= '1')){ $status = "<font color=green>Online</font>"; }else{ $status = "<font color=red>Offline</font>"; }
  print('<tr>
    <td>'.$pega_gms[Name].'</td>
    <td>'.$status.'</td>
  </tr>');
  }
  ?>
</table>

and you use the () in the internal function "echo" because this is a function
 
Mythic Archon
Loyal Member
Joined
Oct 31, 2007
Messages
762
Reaction score
14
Re: [Release]GameMaster On/off php script

this code is very complicated, is big largest
why you use two echo ?
PHP:
echo("$gm['Name'] $stat<br>");
i'm posting my little code here

PHP:
<table width="300" border="0" align="center" cellpadding="2" cellspacing="0">
  <tr>
    <td>Nome</td>
    <td>Status</td>
  </tr>
  <?
  include ("config.php");
  $query = mssql_query("select * from character WHERE CtlCode>='8'");
  $pega_gms = mssql_fetch_array($query);
  for($i=0;$i< mssql_num_rows($query);$i++) {
  $status_stat = mssql_result(mssql_query("SELECT ConnectStat FROM MEMB_STAT WHERE memb___id='$pega_gms[AccountID]'"), 0, 0);
  $pega_account = mssql_num_rows(mssql_query("select GameIDC from AccountCharacter WHERE GameIDC='$pega_gms[AccountID]'"));
  if(($status_stat == '1') || ($pega_account >= '1')){ $status = "<font color=green>Online</font>"; }else{ $status = "<font color=red>Offline</font>"; }
  print('<tr>
    <td>'.$pega_gms[Name].'</td>
    <td>'.$status.'</td>
  </tr>');
  }
  ?>
</table>
and you use the () in the internal function "echo" because this is a function


As i said, I didnt make it. Just posted cus many needs it ^^
 
Junior Spellweaver
Joined
Sep 24, 2007
Messages
190
Reaction score
0
Re: [Release]GameMaster On/off php script

a little noobish question: :)
should i change "name" to the gms nick and accountid to his account id?
 
Newbie Spellweaver
Joined
May 6, 2007
Messages
28
Reaction score
0
Re: [Release]GameMaster On/off php script

<?
include ("config.php");
$query = mssql_query("select c.Name,s.ConnectStat from character c inner join memb_stat s on c.accountid = s.memb___id WHERE c.CtlCode = 8");
while($pega_gms = mssql_fetch_array($query)) {
if($pega_gms["ConnectStat "] == '1'){
$status = "<font color=green>Online</font>";
}else{
$status = "<font color=red>Offline</font>";
}
print('<tr>
<td>'.$pega_gms["Name"].'</td>
<td>'.$status.'</td></tr>');
}
?>

a little simple.
 
Mythic Archon
Loyal Member
Joined
Oct 31, 2007
Messages
762
Reaction score
14
Re: [Release]GameMaster On/off php script

a little noobish question: :)
should i change "name" to the gms nick and accountid to his account id?

You dont need to change anything. It does that by itself :)
 
Junior Spellweaver
Joined
Jul 5, 2007
Messages
181
Reaction score
9
Re: [Release]GameMaster On/off php script

Very good one it will be usefull for me, thanks 10/10
 
Member
Joined
Jan 10, 2007
Messages
530
Reaction score
12
Re: [Release]GameMaster On/off php script

thanks :)
 
Newbie Spellweaver
Joined
Feb 6, 2007
Messages
65
Reaction score
1
Re: [Release]GameMaster On/off php script

you can make a function in PHP or a class. It's more usefull :D
 
Joined
Mar 5, 2004
Messages
58
Reaction score
0
Re: [Release]GameMaster On/off php script

It's the same script that released, just a lil' shorted. Nothing changed.
PHP:
<?PHP

include('config.php');

$query             = mssql_query('SELECT * FROM Character WHERE CtlCode=32');

while($gm          = mssql_fetch_array($query)) {
    $gmname        = $gm['Name'];
    $gmacc         = $gm['AccountID'];
    $is_connected  = mssql_result(mssql_query('SELECT ConnectStat FROM MEMB_STAT WHERE memb___id=\''.$gmacc.'\''), 0, 0);
    $lastCingame   = mssql_result(mssql_query('SELECT GameIDC FROM AccountCharacter WHERE Id=\''.$gmacc.'\''), 0, 0);

    if(($is_connected == 1) && ($lastCingame == $gmname)) {
        $stat = '<FONT color="green"><STRONG>[ON]</STRONG></FONT>';
    }
    else {
        $stat = '<FONT color="red"><STRONG>[OFF]</STRONG></FONT>';
    }
}
echo $gmanme.' '.$stat.'<BR />';
?>
 
Last edited:
Back
Top