Olá, alguém tem alguma source pra limpar inventário ?
procurei aqui não achei...
Printable View
Olá, alguém tem alguma source pra limpar inventário ?
procurei aqui não achei...
Código:void CCommandManager::CommandClearInv(LPOBJ lpObj, char* arg){
int MaxValue = gItemManager.GetInventoryMaxValue(lpObj);
for (int i = INVENTORY_WEAR_SIZE; i < MaxValue; i++)
{
gItemManager.InventoryDelItem(lpObj->Index, i);
gItemManager.GCItemDeleteSend(lpObj->Index, i, 1);
}
gLog.Output(LOG_COMMAND, "[Command Clear Iventory] Use for:[%s][%s]", lpObj->Account, lpObj->Name);
}
Qualquer base MuEMU tem isso..
Muito obrigado, Denis!
Deixa eu te fazer uma pergunta! Adicionei esse comando na minha source 99.60t.
Mais não estou conseguindo adicionar a mensagem dizendo que o inventário já foi limpo caso ele esteja vazio.
Esse é o meu código:
void Commands::LimparInv(int aIndex, char* IpBuffer)
{
if (!this->_Active[17])
{
Function.MsgUser(aIndex, 1, "Comando desabilitado.");
return;
}
else if (gObj[aIndex].Money < this->_Zen[17])
{
Function.MsgUser(aIndex, 1, "É necessário %d de zen.", this->_Zen[17]);
return;
}
else if (this->_VipCount[17] == 1)
{
if (Custom[aIndex].VipCount < 1)
{
Function.MsgUser(aIndex, 1, "Exclusivo apenas para vips.");
return;
}
else
{
for (int i = 0; i < 76; i++)
{
gObjInventoryDeleteItem(aIndex, i);
GCInventoryItemDeleteSend(aIndex, i, 1);
}
GCMoneySend(aIndex, gObj[aIndex].Money -= this->_Zen[17]);
Function.MsgUser(aIndex, 1, "Inventário limpo com sucesso.");
return;
}
}
}
Consegue me da uma luz? Rsrs.
vê se assim funciona:
Não cheguei a testar mas, levando em conta como está, é para funcionar.Código:void Commands::LimparInv(int aIndex, char* IpBuffer)
{
if (!this->_Active[17])
{
Function.MsgUser(aIndex, 1, "Comando desabilitado.");
return;
}
if (gObj[aIndex].Money < this->_Zen[17])
{
Function.MsgUser(aIndex, 1, "É necessário %d de zen.", this->_Zen[17]);
return;
}
if (this->_VipCount[17] == 1 && Custom[aIndex].VipCount < 1))
{
Function.MsgUser(aIndex, 1, "Exclusivo apenas para vips.");
return;
}
for (int i = 0; i < 76; i++)
{
if(gObj[aIndex].pInventory[i].IsItem() == 0)
{
Function.MsgUser(aIndex, 1, "Seu inventário já se encontra limpo.");
return;
}
gObjInventoryDeleteItem(aIndex, i);
GCInventoryItemDeleteSend(aIndex, i, 1);
}
GCMoneySend(aIndex, gObj[aIndex].Money -= this->_Zen[17]);
Function.MsgUser(aIndex, 1, "Inventário limpo com sucesso.");
}