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

C++ Player free Slots/Backpack

Gicu

Well-Known Member
Joined
Feb 26, 2011
Messages
187
Reaction score
52
actions.cpp
I click on corpse and send auto loot items to player BUT if player have no backpack or backpack slots item disappears.
if (player->autoLootList.size() != 0) {

if (player->getCapacity() > 100 * 100) { //Minimum of Capacity for autoloot works. (100 CAP)
for (Item* item : container->getItemList()) {
if (player->getItemFromAutoLoot(item->getID())) {
std::eek:stringstream msgAutoLoot;
msgAutoLoot << "You looted a " << item->getItemCount() << "x " << item->getName() << ".";
g_game.internalMoveItem(container, player, CONST_SLOT_WHEREEVER, item, item->getItemCount(), nullptr);
//player->sendChannelMessage(9, TALKTYPE_CHANNEL_Y, msgAutoLoot.str());
player->sendChannelMessage("[Auto Loot]", msgAutoLoot.str(), TALKTYPE_CHANNEL_O, 9);
}
}
} else {
player->sendTextMessage(MESSAGE_INFO_DESCR, "Sorry, you don't have enough capacity to use auto loot, so it has been disabled. (100+ capacity is required)");
player->sendChannelMessage("[Auto Loot]", "Sorry, you don't have enough capacity to use auto loot, so it has been disabled. (100+ capacity is required)", TALKTYPE_CHANNEL_O, 9);
}
}

1. I need check if player no have free space/slots in backpacks then script stop and write message. Cap is ok.
2. No check player backpacks! Only corpse monster
 
Last edited:
Please, in your posts use the correct code format. I bet a lot of people does not even bother trying to reading that mess
 
Back
Top