zmarketpurchasemax = 0 -> no rebuys instead of infinite

This commit is contained in:
BotoX 2018-01-15 00:37:00 +01:00
parent 6c35c59b81
commit 134ca810d0
2 changed files with 3 additions and 3 deletions

View File

@ -276,7 +276,7 @@ WeaponsCacheData()
// ZMarket (module)
new zmarketprice = KvGetNum(kvWeapons, "zmarketprice", -1);
new zmarketpurchasemax = KvGetNum(kvWeapons, "zmarketpurchasemax", 0);
new zmarketpurchasemax = KvGetNum(kvWeapons, "zmarketpurchasemax", -1);
KvGetString(kvWeapons, "zmarketcommand", zmarketcommand, sizeof(zmarketcommand), "");
new Handle:arrayWeapon = GetArrayCell(arrayWeapons, x);

View File

@ -811,7 +811,7 @@ ZMarketMenuTypeWeapons(client)
}
// If max purchases is disabled for the weapon, then set as known integer to be later replaced.
if (purchasemax <= 0)
if (purchasemax < 0)
{
purchasesleft = -1;
}
@ -962,7 +962,7 @@ stock bool:ZMarketEquip(client, const String:weapon[], bool:rebuy = false)
new purchasemax = WeaponsGetZMarketPurchaseMax(weaponindex);
new purchasecount = ZMarketGetPurchaseCount(client, weapon);
new purchasesleft = purchasemax - purchasecount;
if (purchasemax > 0 && purchasesleft <= 0)
if (!rebuy && purchasemax >= 0 && purchasesleft <= 0)
{
TranslationPrintToChat(client, "Weapons zmarket purchase max", weapondisplay, purchasemax);
return false;