• 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!

AAC [MyAAC] Disable Sample Players

Pavinski

Member
Joined
May 28, 2020
Messages
30
Reaction score
5
Hello!

Does anyone know how to disable Sample Players? This way new players get their starting items from a script I have instead of based on what the sample players have.

Also, what are the advantages/disadvantages of using a lua script to load starting items instead of the sample players?

Lastly, if I keep the sample players, what’s the best way to hide them from the high scores and player lists?

Thank you in advance!
 
Solution
It doesn't matter if you use a script or sample characters.

Can't you just clean the sample characters items?

Reinstall MyAAC, it should hide them automatically in config.local.php.

If it won't, you can put this into your config.local.php:
Code:
$config['highscores_ids_hidden'] = array(3, 4, 5, 6, 7);

Where 3,4,5,6,7 are IDS of hidden characters.
It doesn't matter if you use a script or sample characters.

Can't you just clean the sample characters items?

Reinstall MyAAC, it should hide them automatically in config.local.php.

If it won't, you can put this into your config.local.php:
Code:
$config['highscores_ids_hidden'] = array(3, 4, 5, 6, 7);

Where 3,4,5,6,7 are IDS of hidden characters.
 
Solution
It doesn't matter if you use a script or sample characters.

Can't you just clean the sample characters items?

Reinstall MyAAC, it should hide them automatically in config.local.php.

If it won't, you can put this into your config.local.php:
Code:
$config['highscores_ids_hidden'] = array(3, 4, 5, 6, 7);

Where 3,4,5,6,7 are IDS of hidden characters.

Thank you for your reply! You are right, I can just clean the characters, but wanted to see if there was a way to disable them to reduce accidents when testing (like grabbing a daily reward with a sample character when testing for example) and also to learn about the code a bit more. :)

I have the latest version and see that they are automatically hidden. Thank you for pointing me to the place where they are hidden. This will be useful for me to hide other test characters
 
You can't disable them completely, because that's the way it works.

You can however disable items creation from sample characters, by removing this part of code in system/libs/CreateCharacter.php:
Code:
$loaded_items_to_copy = $db->query("SELECT * FROM player_items WHERE player_id = ".$char_to_copy->getId()."");
foreach($loaded_items_to_copy as $save_item)
   $db->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']."');");
 
You can't disable them completely, because that's the way it works.

You can however disable items creation from sample characters, by removing this part of code in system/libs/CreateCharacter.php:
Code:
$loaded_items_to_copy = $db->query("SELECT * FROM player_items WHERE player_id = ".$char_to_copy->getId()."");
foreach($loaded_items_to_copy as $save_item)
   $db->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 for your help! Awesome support on your tools
 
It doesn't matter if you use a script or sample characters.

Can't you just clean the sample characters items?

Reinstall MyAAC, it should hide them automatically in config.local.php.

If it won't, you can put this into your config.local.php:
Code:
$config['highscores_ids_hidden'] = array(3, 4, 5, 6, 7);

Where 3,4,5,6,7 are IDS of hidden characters.
thanks! we love you :D
 
Back
Top