Цитата:
Сообщение от KiriX
Юзербар поправить не так уж и сложно...
|
Действительно? Я например немогу допереть как переделать это
Код:
public function getAllProfessions(){
$exists = false;
for ($i=PLAYER_SKILL_INFO_1_1; $i<PLAYER_CHARACTER_POINTS1; $i+=3){
if (!$this->getFieldData($i)) continue;
$skill = $this->getFieldData($i);
if ($skill > 65536) $skill -= 65536;
if(in_array($skill,self::$PROFESSIONS)) {
$prof["skill"] = $skill;
$prof["value"] = $this->getFieldData($i+1) % 65536;
$this->profs[] = $prof;
$exists = true;
}
}
return $exists;
}
правильно ли делать так (ставить запросы через запятую. Я не изучал php!!)
Код:
public function getHealth(){
return array
(
$this->cDB->selectCell("SELECT `health` FROM `characters` WHERE `guid`=?d ",$this->guid),
$this->cDB->selectCell("SELECT `maxhealth` FROM `character_stats` WHERE `guid`=?d ",$this->guid)
);
}
откуда теперь брать
Код:
$this->getFieldData(PLAYER_NEXT_LEVEL_XP)
Тут вообще непонятки... Это получается мы должны проверять, нашёл ли запись с guid игрока в таблице guild_member, но как?
Код:
public function inGuild(){
if(!$this->getFieldData(PLAYER_GUILDID))
return false;
else{
$this->guildID = $this->getFieldData(PLAYER_GUILDID);
$this->guildName = $this->cDB->selectCell("SELECT `name` FROM `guild` WHERE guildid=?d ",$this->guildID);
$this->guildRank = $this->cDB->selectCell("SELECT `rname` FROM `guild_rank` WHERE guildid=?d && rid=?d",$this->guildID,$this->getFieldData(PLAYER_GUILDRANK));
return true;
}
}
public function isGuildLeader(){
if(!$this->inGuild())
return false;
if($this->getFieldData(PLAYER_GUILDRANK)=='0')
return true;
return false;
}