View Single Post
Old 07.07.2007, 22:52   #24
hel
Архивный участник
 
Join Date: Apr 2006
Posts: 729
Default

Guaresnay:
1. why you're getting itemnames through sql and not simply parse item_pch?
Code:
foreach(file("item_pch.txt") as $iitem){
	str_replace(array("\xFF\xFE","\x00"),"",trim($iitem));
	$iitem=str_replace(array(" ","\t"),"",$iitem);
	$eitem=explode("=",$iitem);
	$itemids[($eitem[1])]=str_replace(array("[","]"),"",$eitem[0]);
}
// after that you may use for example $itemids[1], it returns short_sword.
as you see, there is many citizen classes. why not set as there:
Code:
function get_type($type){
	switch($type){
		...
		default:
			$type="citizen";break; //every case need to break, or switch will continue from begining, you forgot about it.
	}
	return $type;
}
the $type=$type is wrong. it will cause l2server parsing problems.
hel is offline