View file game/1/f_speakfrombankto.dat

File size: 1.21Kb
<?php
	// $to из банка
		if (strpos($to,"_")!==false) $ti=substr($to,0,strpos($to,"_")); else
		if (strpos($to,"-")!==false) $ti=substr($to,0,strpos($to,"-")); else $ti=$to;
		if (substr($to,0,5)=="i.rr.") $item=explode("|","руна|50"); else if (file_exists("items/".$ti)) $item=explode("|",implode("",file("items/".$ti))); else die("err: no items/".$to);
		$count=intval(preg_replace('/.*'.$to.':(\d+).*/',"\\1",$l_i[$loc][$login]["bank"]));
		if ($count==0) msg("<small><b>В банке нет $item[0]</b></small>".$metr,$tchar[0]);
		if ($count>1 && !$num) {		// кол-во
			$stmp="<p><small><b>Укажите количество:\n<br/><input name=\"num\" format=\"*N\" maxlength=\"7\" value=\"".$count."\"/>\n<br/><a href=\"$PHP_SELF?sid=$sid&speak=$speak&id=$id&start=$start&to=$to&num=$(num)\">Отправить</a><br/><a href=\"$PHP_SELF?sid=$sid&speak=$speak&id=$id&start=$start&to=$to&num=999999999999999\">забрать все</a></b></small>";
			msg($stmp,$tchar[0],1,"","num",$count);
			}
		if (!$num || $num<1) $num=1;
		if ($num>$count) $num=$count;
		additem($loc,$login,$login,$to,$num,"bank","items",0,-1,1);
		msg("<small><b>Вы забрали из банка ".$num." ".$item[0]."<br/><a href=\"$PHP_SELF?sid=$sid&speak=$speak&id=$id&start=$start\">Продолжить</a></b></small>");