View Full Version : |Pedido| Limpar inventário
embreve
10-27-2024, 02:58 PM
Olá, alguém tem alguma source pra limpar inventário ?
procurei aqui não achei...
lkt22
10-27-2024, 05:50 PM
Olá, alguém tem alguma source pra limpar inventário ?
procurei aqui não achei...
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);
}
embreve
10-27-2024, 06:46 PM
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);
}
vlw obrigado.
3 Horas 34 minutes:------- Atualizado -------
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);
}
Sabe me dizer de qual projeto é esse comando?
lkt22
10-27-2024, 10:56 PM
Qualquer base MuEMU tem isso..
embreve
10-27-2024, 11:23 PM
Qualquer base MuEMU tem isso..
Poderia me mandar o link da qual você pegou esse comando?
Preciso de algumas referencias para adicionar na minha versão.
As que eu baixei aqui não tinha esse comando.
Muito obrigado.
Segredo
10-28-2024, 12:39 AM
Poderia me mandar o link da qual você pegou esse comando?
Preciso de algumas referencias para adicionar na minha versão.
As que eu baixei aqui não tinha esse comando.
Muito obrigado.
Source do Louis e Sources da SSEMU tem esse sistema.
embreve
10-29-2024, 12:33 AM
Source do Louis e Sources da SSEMU tem esse sistema.
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.
Segredo
10-29-2024, 08:18 AM
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:
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.");
}
Não cheguei a testar mas, levando em conta como está, é para funcionar.
embreve
10-29-2024, 10:43 AM
vê se assim funciona:
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.");
}
Não cheguei a testar mas, levando em conta como está, é para funcionar.
Bom dia, Denis! Primeira mente muito obrigado pela boa vontade em querer me ajudar.
Então, com o inventário com item, recebo a mensagem: Seu inventário já se encontra limpo.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.