Post Pacific  

Go Back   Post Pacific > Lineage 2 > Lineage 2 Server Modifications ONLY!

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 17.11.2006, 15:47   #10
Charis
Архивный участник
 
Join Date: Feb 2006
Posts: 39
Default

I can not make DelItem function work (13).
It returns 01 all the time.

Does anybody succeded in using it?

I'm using a little different code, but an original doesn't seems to work too.

Code:
function ansi2unicode($string) {
    $rs = ""; for($i = 0; $i < strlen($string); $i++) $rs .= $string[$i].chr(0);
    return($rs.chr(0).chr(0));
}

function l2_cached_push($buf){
$cached_ip = "127.0.0.1";
$cached_port = "2012";
$fp = fsockopen($cached_ip, $cached_port, $errno, $errstr, 5); $rs = ""; 
if(!$fp)return 0; 
else{ 
    fwrite($fp, pack("s", (strlen($buf)+2)).$buf);
    $len = unpack("v", fread($fp, 2)); $rid = unpack("c", fread($fp, 1));
    for ($i = 0; $i < (($len[1]-4) / 4); $i++) { $read = unpack("i", fread($fp, 4)); $rs .= $read[1]; }
    stream_set_timeout($fp, 2);
    $answ=$rs;
    fclose($fp);
    return "$answ";
  }
 }

function l2_delItem ( $webadmin, $char_id, $warehouse, $item_id, $amount) { 
    $cached_op = pack("c", 13); 
    $cached_op .= pack("i", $char_id);
    $cached_op .= pack("i", $warehouse);
    $cached_op .= pack("i", $item_id);
    $cached_op .= pack("i", $amount);
    $cached_op .= ansi2unicode ( $webadmin ); 
  $rs = l2_cached_push ($cached_op); 
  return ( $rs ); 
}
$adena_id is an item id for Adena in char inventory, not the item_type.
$changeacccost - some value like 10000.
Code:
$answ = l2_delItem ( $_COOKIE['login'], $char_id, 0, $adena_id, $changeacccost);
$answ is always "01"

Function like Kick and MoveChar is working... But DeleteItem - does not
Charis is offline  
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:19.