INVENTORY BUYING ITEMS

08/22/2016 13:36 Umlook#1
Hey,

I need your help in order to get inventory buy items directly. I've started code it but it doesn't work at all. So I was wondering if there was any source with that kind of system "_INVENTORY_BUY_ITEM".

Thanks in advance, it's more than 2 weeks that i'm working on.
08/22/2016 14:42 alfredico#2
In less than two weeks, you can learn basis of C++ and do it.
08/22/2016 14:46 Kaev <3#3
Quote:
Originally Posted by Umlook View Post
Hey,

I need your help in order to get inventory buy items directly. I've started code it but it doesn't work at all. So I was wondering if there was any source with that kind of system "_INVENTORY_BUY_ITEM".

Thanks in advance, it's more than 2 weeks that i'm working on.
Instead of saying "it doesn't work at all" you could show us your code and we could analyze what's going wrong.
08/22/2016 16:09 Rhyder`#4
Code:
void CDPSrvr::OnGetRemantis(CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE, u_long)
{
	CUser* pUser = g_UserMng.GetUser(dpidCache, dpidUser);
	u_long idPlayer;
	if (IsValidObj(pUser))
	{
		ar >> idPlayer;
		if (idPlayer != pUser->m_idPlayer)
			return;

		if (pUser->m_Inventory.GetEmptyCount() > 0 || pUser->m_Inventory.GetAtItemId(II_CHR_FOO_COO_REMANTIS) )
		{
			if (pUser->GetGold() >= 100000)
			{
				CItemElem item;
				item.m_nItemNum = 1;
				item.m_dwItemId = II_CHR_FOO_COO_REMANTIS;
				if (pUser->CreateItem(&item))
				{
					pUser->AddGold(-100000);
					pUser->AddText("Remantis successfully purchased!");
				}
				else{
					pUser->AddText("Failed to purchase Remantis!");
				}
			}
			else{
				pUser->AddText("Not enough penya.");
				return;
			}
		}
		else{
			pUser->AddText("Your Inventory is full.");
			return;
		}
	}
}
same method with perin converter good luck!