Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server
You last visited: Today at 22:37

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Metin2-PHP hilfe bitte Wheel..

Discussion on Metin2-PHP hilfe bitte Wheel.. within the Metin2 Private Server forum part of the Metin2 category.

Reply
 
Old   #1
 
elite*gold: 6442
Join Date: Jun 2015
Posts: 366
Received Thanks: 70
Metin2-PHP hilfe bitte Wheel..

Hallöle, ich bin neu im Bereich PHP und wollte fragen ob mir jemadn folgendes script anpasst so das es die items direkt ins IS-Lager packt?.. Danke schonmal

PHP Code:
<?php
include_once '../extern/config.php';
include_once 
'../funkcie.php';

$i file('items.txt');
$bb ISHOP_WHEEL_PRICE;

$cc count($i);
$dd = array();

for(
$ee=10;$ee<$cc;$ee++)
{
  
$dd[] = explode(' ',$i[$ee]);
}
$ff count($dd)-1;
$gg = array();
$hh = array();
for(
$ii=0;$ii<16;$ii++)
{
  
$jj 1;
  
$kk 0;
  while(
$jj $kk)
  {
    
$ll rand(0,$ff);
    while(
in_array($ll,$gg))
    {
      
$ll rand(0,$ff);
    }
    
$kk 18*$dd[$ll][3];
    
$jj rand(0,100);
  }
  
$gg[$ii] = $ll;
  
$hh[] = $dd[$gg[$ii]];
}

mysql_connect(GAME_MYSQL_HOST,GAME_MYSQL_USER,GAME_MYSQL_PASSWORD) or die(mysql_error());
$mm mysql_query("SELECT * FROM ".GAME_MYSQL_ACCOUNT.".account WHERE id='".$_SESSION['ISHOP_SESSION_ID']."' LIMIT 1") or die(mysql_error());
$nn mysql_fetch_assoc($mm);
$oo $nn[ISHOP_COLUMN_COINS];
if(
$oo >= $bb)
{
  
$hh[] = rand(0,15);
  
$pp $hh[$hh[16]];
  
$qq mysql_query("SELECT locale_name,vnum FROM ".GAME_MYSQL_PLAYER.".item_proto WHERE vnum='".$pp[1]."' LIMIT 1") or die(mysql_error());
  if(!
$qq)
  {
    
$hh[16]=-1;
    echo 
json_encode($hh);
    exit();
  }
  
$rr mysql_fetch_assoc($qq);
  
$ss $rr['locale_name'];
  
$hh[] = $ss;
  
/*
  $tt = compareItems($rr['vnum']);
  $uu = checkPos(1);
  $vv = najdiMiesto($uu['islager'],$tt['velkost']);
  */
  
$query mysql_query("SELECT * FROM ".ISHOP_MYSQL_DB.".stock_items_".ISHOP_TABLE_POSTFIX." WHERE vnum='".$pp[1]."' AND user_id='".$_SESSION['ISHOP_SESSION_ID']."' LIMIT 1") or die(mysql_error());
  if(
mysql_num_rows($query) > "0")
  {
    
$xx mysql_query("UPDATE ".ISHOP_MYSQL_DB.".stock_items_".ISHOP_TABLE_POSTFIX." SET count=count+".$pp[2]." WHERE vnum='".$pp[1]."' AND user_id='".$_SESSION['ISHOP_SESSION_ID']."' LIMIT 1") or die(mysql_error());
  }
  else
  {
    
$xx mysql_query("INSERT INTO ".ISHOP_MYSQL_DB.".stock_items_".ISHOP_TABLE_POSTFIX." (vnum,count,user_id)VALUES('".$pp[1]."','".$pp[2]."','".$_SESSION['ISHOP_SESSION_ID']."')") or die(mysql_error());
  }
  
//$ww="INSERT INTO ".GAME_MYSQL_PLAYER.".item (owner_id,window,pos,count,vnum,attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, socket0, socket1, socket2)VALUES('".$_SESSION['ISHOP_SESSION_ID']."','MALL','".$vv[0]."','".$pp[2]."','".$pp[1]."','0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')";
  //$xx=mysql_query($ww);
  
if(!$xx)
  {
    exit();
  }
  
$zz mysql_query("UPDATE ".GAME_MYSQL_ACCOUNT.".account SET ".ISHOP_COLUMN_COINS."=".ISHOP_COLUMN_COINS."-".$bb.", ".ISHOP_COLUMN_MARKS."=".ISHOP_COLUMN_MARKS."+".$bb." WHERE id='".$_SESSION['ISHOP_SESSION_ID']."' LIMIT 1") or die(mysql_error());
  
//$zz=mysql_query($yy);
}
else
{
  
$hh[] = -1;
}
echo 
json_encode($hh);
//echo var_dump($hh);

?>
Yunora is offline  
Old 06/26/2015, 16:16   #2
 
elite*gold: 228
Join Date: Jun 2015
Posts: 81
Received Thanks: 10
Ich denke da bist du in der Programmier-Sektion hier besser aufgehoben als in Metin2.
Das liegt ja eher an dem Script als an dem Spiel. :P



Am besten im Web Development


Gruß
siqnz is offline  
Old 06/27/2015, 10:45   #3



 
.aNNdii#'s Avatar
 
elite*gold: 1
Join Date: Aug 2008
Posts: 7,744
Received Thanks: 3,605
Arrow Metin2 Main - Discussions / Questions -> Metin2 PServer - …

#moved…
.aNNdii# is offline  
Old 06/27/2015, 12:30   #4


 
elite*gold: 50
Join Date: Aug 2013
Posts: 1,713
Received Thanks: 1,389
Ich würde dir ja gern helfen aber dein Code ist schräklich.
Aber um dir dennoch etwas weiter helfen zu können geb ich dir ein
Tipp wie du Sachen in die Datenbank speichern kannst.
INSERT INTO aber weitere Info's darüber findest du hier:
/exit is offline  
Old 06/29/2015, 18:33   #5
 
elite*gold: 6442
Join Date: Jun 2015
Posts: 366
Received Thanks: 70
das klappt ja alles kommt auch in die player.item aber sobald ein item den slot belegt (andere sind noch frei, im ISlager) kommt nichts mehr rein!
Yunora is offline  
Old 06/29/2015, 18:54   #6
 
elite*gold: 0
Join Date: Apr 2015
Posts: 428
Received Thanks: 361
Ja kann ich dir machen ist kein Problem, schicks entweder hier auf Epvp, damit andere dir auch helfen oder sende mir das Script privat über Skype: mrx.epvp
#Metho is offline  
Old 06/29/2015, 19:09   #7
 
elite*gold: 0
Join Date: Oct 2013
Posts: 239
Received Thanks: 70
Quote:
aber sobald ein item den slot belegt (andere sind noch frei, im ISlager) kommt nichts mehr rein!
Die Slots im IS-Lager haben alle eine feste Zahl. Du musst das Script also nur anweisen, sich die leeren Slots aus der DB zu suchen und dann den/die passenden freien Slot nutzen.
ihrnervt is offline  
Old 06/29/2015, 19:16   #8
 
elite*gold: 6442
Join Date: Jun 2015
Posts: 366
Received Thanks: 70
kann mir einer die datei anpassen, das ist die datei wo die items ins is lager sollen
Yunora is offline  

Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.