• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Fixed Account Creating - giving items.

Zonet

Web Developer
Joined
Sep 1, 2008
Messages
4,393
Reaction score
52
Location
Tibia VS RL-life, guess whos back?
Hello, I noticed that it wasn't giving items to character at the create account page. It was only giving you items when you created character when you was logged in.

Here it is:
system/application/controllers/account.php
Put it under $player->save();
PHP:
						$player->find($_POST['character_name']);
						if($player->isLoaded())
						{
							$player->setCustomField('world_id', (int) $_POST['world']);
							$player->setSkill(0,$sample->getSkill(0));
							$player->setSkill(1,$sample->getSkill(1));
							$player->setSkill(2,$sample->getSkill(2));
							$player->setSkill(3,$sample->getSkill(3));
							$player->setSkill(4,$sample->getSkill(4));
							$player->setSkill(5,$sample->getSkill(5));
							$player->setSkill(6,$sample->getSkill(6));
							$player->save();
							$SQL = POT::getInstance()->getDBHandle();
							$loaded_items_to_copy = $SQL->query("SELECT * FROM player_items WHERE player_id = ".$sample->getId()."");
							foreach($loaded_items_to_copy as $save_item)
								$SQL->query("INSERT INTO `player_items` (`player_id` ,`pid` ,`sid` ,`itemtype`, `count`, `attributes`) VALUES ('".$player->getId()."', '".$save_item['pid']."', '".$save_item['sid']."', '".$save_item['itemtype']."', '".$save_item['count']."', '".$save_item['attributes']."');");
						}
 
thank you thank you. rep ++ after i test it.

i cant get it to work. after i put in your code when i go to create an account it just brings me to a blank white page. when i remove your code the create account page works again( minus giving the first new char of the acc eq).
 
Last edited:
post the whole file then if you dont mind. i put this in the script right where you said to and it didnt work. just tried it again idk what im doing right.
 
Back
Top