
Originally Posted by
embreve
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:
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.");
}
Não cheguei a testar mas, levando em conta como está, é para funcionar.