示例#1
0
 /**
  * @version 0.1.3
  * @since 0.0.5
  * @param int $id Vocation ID.
  * @return string Name.
  * @throws E_OTS_NotLoaded If vocations list is not loaded.
  * @deprecated 0.1.3 Use POT::getVocationsList()->getVocationName().
  */
 public function getVocationName($id)
 {
     if (isset($this->vocations)) {
         return $this->vocations->getVocationName($id);
     }
     throw new E_OTS_NotLoaded();
 }
示例#2
0
<?php

// to not repeat all that stuff
include 'quickstart.php';
// loads vocations
$vocations = new OTS_VocationsList('/home/wrzasq/.otserv/data/vocations.xml');
// translates ID to vocation name
echo $vocations->getVocationName(1);
// translates vocations name to it's ID
echo $vocations->getVocationID('Knight');