<tr bgcolor=\'#505050\'><td colspan=\'2\' class=\'white\'><center><b>Other systems</b></center></td></tr> <tr bgcolor=' . $config['site']['lightborder'] . '><td width="150"><b><a href="?subtopic=adminpanel&action=install_monsters">Reload Monsters</a></b></td><td><small><b>Load information about monsters from directory "/data/monsters/".</b></small> <b><small>[Delete old mosters configuration!]</small></b></td></tr> <tr bgcolor=' . $config['site']['darkborder'] . '><td width="150"><b><a href="?subtopic=adminpanel&action=install_spells">Reload Spells</a></b></td><td><small><b>Load information about spells from file "/data/spells/spells.xml".</b></small><br/><b><small>[Delete old spells configuration!]</small></b></td></tr> <tr bgcolor=' . $config['site']['darkborder'] . '><td width="150"><b><a href="?subtopic=adminpanel&action=npc_check_by_mappingfor&lng=en">Check NPCs</a> [EN]</b></td><td><b><small>Check items prices.</small></b></td></tr> </table><br/>'; } if (!empty($_GET['name'])) { $name = $_GET['name']; $name_new = $_GET['name_new']; $player = new OTS_Player(); $player->find($name); if ($player->isLoaded() && $player->isNameLocked()) { if ($name_new == $player->getOldName()) { if ($action == 'accept') { $main_content .= '<font color="green">Changed name from <b>' . $player->getName() . '</b> to <b>' . $player->getOldName() . '</b>.</font>'; $player->setCustomField('old_name', $player->getName()); $player->setCustomField('name', $player->getOldName()); $player->setCustomField('nick_verify', 1); $player->removeNameLock(); } elseif ($action == 'reject') { $main_content .= '<font color="green">Rejected proposition of change name from <b>' . $player->getName() . '</b> to <b>' . $player->getOldName() . '</b>.</font>'; $player->setCustomField('old_name', ''); } } else { $main_content .= '<font color="red">Invalid new name. Try again.</font><br>'; } } else { $main_content .= '<font color="red">Player with this name doesn\'t exist or isn\'t namelocked.</font><br>'; } } $main_content .= '<table border="0" CELLPADDING=4 CELLSPACING=1 style="border: 1px solid black;margin: 0 auto;width: 80%;">
<?php // to not repeat all that stuff include 'quickstart.php'; // creates new OTS_Player object $player = new OTS_Player(); // sets basic fields $player->setName('Wrzasq'); $player->setSex(POT::SEX_MALE); $player->setVocation(POT::VOCATION_KNIGHT); /* etc... */ /* this is bad! we can't call this now as we dont have object ID assinged yet $player->setCustomField('my_field', 2); must save before that to get automatic ID: */ $player->save(); // now we can call that: // 2 won't be quoted - it's integer $player->setCustomField('my_field', 2); // 3 will be quoted - '3' is a string! $player->setCustomField('another_field', '3');