Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   [How?]To ban player for a time? (https://postpacific.loc-online.com/showthread.php?t=4225)

xarion 29.04.2006 08:42

[How?]To ban player for a time?
 
:)

Как забанить перса на время, к примеру на неделю, может тулза какае-то есть удобная?

Подскажите, а то баны - всегда безвременные :)

xarion 29.04.2006 08:42

[How?]To ban player for a time?
 
:)

Как забанить перса на время, к примеру на неделю, может тулза какае-то есть удобная?

Подскажите, а то баны - всегда безвременные :)

pipise4ko 29.04.2006 12:03

поищи l2z system, она на пхп, оч удобная вещь, там и бан и разбан, ренейм, телепорт, кароче всё что нужно

bigfoot 29.04.2006 12:07

Code:

<?
/* CONFIGURABLE SETTINGS */
$dbip = 'ipaddress';

/* END OF CONFIRABLE SETTINGS */

/* DO NOT EDIT SETTINGS BELOW HERE! */
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
$t=0;
$arCoord = array();
$arCoord[$t++] = array("Giran PvP Arena" ,'72955',' 143428',' -3768');
$arCoord[$t++] = array("Talking Island" ,'-83998,1',' 244610,3',' -3730,3');
$arCoord[$t++] = array("Gludin"              ,'-80749,0',' 149834,0',' -3044,8');
$arCoord[$t++] = array("Gludio"              ,'-12697,0',' 122776,0',' -3117,8');
$arCoord[$t++] = array("Dion"                ,' 15744,0',' 142928,0',' -2706,8');
$arCoord[$t++] = array("Giran"              ,' 83336,0',' 147922,0',' -3405,8');
$arCoord[$t++] = array("Oren"                ,' 83011,0','  53207,0',' -1496,8');
$arCoord[$t++] = array("Ivory Tower"      ,' 85391,0','  16228,0',' -3674,7');
$arCoord[$t++] = array("Hunters Village",'117156,0','  76878,0',' -2695,4');
$arCoord[$t++] = array("Hardins PA"        ,'105846,0',' 109762,0',' -3204,4');
$arCoord[$t++] = array("Aden"                ,'146705,0','  25840,0',' -2013,8');
$arCoord[$t++] = array("Elven Village"    ,' 46890,0','  51531,0',' -2977,9');
$arCoord[$t++] = array("Talking Island" ,'-84141,0',' 244623,0',' -3730,3');
$arCoord[$t++] = array("Orcs Village"      ,'-45158,0','-112583,0','  -240,6');
$arCoord[$t++] = array("Dwarven Village",'115120,0','-178224,0','  -898,6');
$arCoord[$t++] = array("Wastelands"        ,'-16730,0',' 209417,0',' -3665,6');
$arCoord[$t++] = array("Death Valley AL",'131214,8',' 114461,9',' -3719,7');
$arCoord[$t++] = array("Heart of Ward," ,'154570,2',' 121152,0',' -7708,8');


function admin_kick($char)
{
  $szCmd = ("5" . "\t" . $char. "\t" . "\r\n");
  if(SendCommand($szCmd)==1)
  {
    $str = "CHAR KICKED: CHAR NAME: $char by: ".$_SERVER['PHP_AUTH_USER'];
    $content .=($str);
  }
  else
  {
    $content .=("Kick Error? =[");
  }
return $content;
}

function admin_ban($char, $hour)
{
  $szCmd = ("39" . "\t" . $char. "\t" .$hour. "\t" . "\r\n");
  if(SendCommand($szCmd)==1)
  {
    $str = "CHAR BANNED: CHAR NAME: $char ; BANTIME: $hour by: ".$_SERVER['PHP_AUTH_USER'];
    $content .=($str);
  }
  else
  {
    $content .=("Ban Error? =[");
  }
return $content;
}

function admin_move($char,$arCoord) {
$nMoveTo = intval($_POST['MoveTo']);


if(($nMoveTo>=0)&&($nMoveTo<count($arCoord))&&(!empty($char)))
{
  $xloc = floatval($arCoord[$nMoveTo][1]);
  $yloc = floatval($arCoord[$nMoveTo][2]);
  $zloc = floatval($arCoord[$nMoveTo][3]);
  $szCmd = "2"."\t".$char."\t"."1"."\t".$xloc."\t".$yloc."\t".$zloc."\t"."PHP_MOVER"."\t"."\r\n";
  if(SendCommand($szCmd)==1)
  {
    $str = "CHAR '".$char."' MOVED TO x= $xloc ; y= $yloc ; z= $zloc by: ".$_SERVER['PHP_AUTH_USER'];
    $content .=($str);
  }
  else
  {
    $content .=("Move char Error? =[");
  }
}
return $content;
}

function SendCommand($str)
{
  global $dbip;

  $fp = fsockopen($dbip, 2009, $errno, $errstr);
  if(!$fp)
  {
    echoLn("Error: $errstr ($errno)");
    return(0);
  }
  fwrite($fp, $str);
  stream_set_timeout($fp, 2);
  $ret = fgets($fp,8);
  fclose($fp);
  return($ret);
}

$TargetChar = $_POST['TargetChar'];
$BanTime = $_POST['BanTime'];

switch ($_POST['switch'])
{
       
        case 'kick':
                $content .= admin_kick($TargetChar);
                break;
       
        case 'move':
                $content .= admin_move($TargetChar, $arCoord);
                echo "check";
                break;
       
        case 'ban':
                $content .= admin_ban($TargetChar, $BanTime);
                break;
}





$content .="</pre>
<FORM METHOD=POST>
  MOVE CHAR:
  <INPUT TYPE=hidden name=switch value='move'>
  <INPUT TYPE='text' NAME='TargetChar' size='10'>
  TO
  <SELECT NAME='MoveTo'>
";

for($i=0; $i<count($arCoord); $i++)
{
  $FormHtml .= "<OPTION value=".$i.">".$arCoord[$i][0];
}

$FormHtml.= "
  </SELECT>
  <INPUT TYPE='submit' value='Travel!'>
</FORM>
";

$content .= $FormHtml;

$content .="
<FORM METHOD=POST>
  KICK CHAR:
  <INPUT TYPE='hidden' name=switch value='kick'>
  <INPUT TYPE='text' NAME='TargetChar' size='10'>
 <INPUT TYPE='submit' value='KICK!'>
</FORM>
";

$content .="
<FORM METHOD=POST>
  BAN CHAR:
  <INPUT TYPE='hidden' name=switch value='ban'>
  <INPUT TYPE='text' NAME='TargetChar' size='10'>
  BANTIME(в часах):
  <INPUT TYPE='text' NAME='BanTime' size='10'>
 <INPUT TYPE='submit' value='BAN!'>
</FORM>
";

echo $content;

echo "

 Scripts Provided By Toolz Support Forums @ http://johnd.mrqgamez.com/";
?>

немного доработаный скрипт,
скрипт работает с кэшем

xarion 29.04.2006 12:29

Во нормально, судя по отзывам совсем неплохая вещь.


All times are GMT. The time now is 15:59.