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

[Request] function for open containers

perdigs

New Member
Joined
Aug 22, 2010
Messages
114
Reaction score
1
Hello I have a server and it got an item that he is both a container as an object for use with, but it's so good to use but when you click on it and right click on the option open, it does not open the container and its slots so if possible I would give a function that the use of myself it shows up the slots in the container of this item ... have not found any function to open containers.

Sorry for the English, im from Brasil....:thumbup:
 
ask someone to modify (its part of game.cpp):
PHP:
bool Game::playerMoveUpContainer(uint32_t playerId, uint8_t cid)
{
	Player* player = getPlayerByID(playerId);
	if(!player || player->isRemoved())
		return false;

	Container* container = player->getContainer(cid);
	if(!container)
		return false;

	Container* parentContainer = dynamic_cast<Container*>(container->getParent());
	if(!parentContainer)
		return false;

	player->addContainer(cid, parentContainer);
	player->sendContainer(cid, parentContainer, (dynamic_cast<const Container*>(parentContainer->getParent()) != NULL));
	return true;
}
and add function to luascripts.cpp/.h and make script that use lua function (actions) when someone use item.

I think it should work.
 
Back
Top