Apoi adaugam la finalul functiei urmatorul cod:
Cod: Selectaţi tot
if (item->GetVnum() >= 80003 && item->GetVnum() <= 80007)
{
int VnumLingouri[] = {80003, 80004, 80005, 80006, 80007};
long SumaLingouri[] = {10000000, 50000000, 100000000, 500000000, 1000000000};
for (int i = 0; i < _countof(VnumLingouri); i++)
{
if (item->GetVnum() == VnumLingouri[i])
{
if (GetExchange())
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu poti să deschizi un lingou cât timp negociezi."));
return false;
}
else
item->SetCount(item->GetCount() - 1);
PointChange(POINT_GOLD, SumaLingouri[i], true);
return true;
}
}
return false;
}Cod: Selectaţi tot
if (item->GetVnum() >= 80003 && item->GetVnum() <= 80007)
{
int VnumLingouri[] = {80003, 80004, 80005, 80006, 80007};
long SumaLingouri[] = {10000000, 50000000, 100000000, 500000000, 1000000000};
long MaxiLingouri[] = {1989999999, 1949999999, 1899999999, 1499999999, 999999999};
for (int i = 0; i < _countof(VnumLingouri); i++)
{
if (item->GetVnum() == VnumLingouri[i])
{
if (GetExchange())
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu poti s? deschizi un lingou cat timp negociezi."));
return false;
}
else
{
if (item->GetVnum() == VnumLingouri[i] && GetGold()>= MaxiLingouri[i])
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu poti deschide lingoul pentru ca ai prea mult yang in inventar !"));
return false;
}
if (item->GetVnum() == VnumLingouri[i+1] && GetGold()>= MaxiLingouri[i+1])
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu poti deschide lingoul pentru ca ai prea mult yang in inventar !"));
return false;
}
if (item->GetVnum() == VnumLingouri[i+2] && GetGold()>= MaxiLingouri[i+2])
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu poti deschide lingoul pentru ca ai prea mult yang in inventar !"));
return false;
}
if (item->GetVnum() == VnumLingouri[i+3] && GetGold()>= MaxiLingouri[i+3])
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu poti deschide lingoul pentru ca ai prea mult yang in inventar !"));
return false;
}
if (item->GetVnum() == VnumLingouri[i+4] && GetGold()>= MaxiLingouri[i+4])
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nu poti deschide lingoul pentru ca ai prea mult yang in inventar !"));
return false;
}
else
{
item->SetCount(item->GetCount() - 1);
PointChange(POINT_GOLD, SumaLingouri[i], true);
return true;
}
}
}
}
return false;
}




