Fixed ZMarket bug that took money even if it was restricted or purchase count had been reached. (On rebuy)
This commit is contained in:
		| @@ -785,22 +785,6 @@ stock bool:ZMarketEquip(client, const String:weapon[], bool:rebuy = false) | |||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
|      |      | ||||||
|     // Get client's current money. |  | ||||||
|     new cash = AccountGetClientCash(client); |  | ||||||
|      |  | ||||||
|     // If client doesn't have enough money, tell them, resend menu, and then stop. |  | ||||||
|     if (cash < itemprice) |  | ||||||
|     { |  | ||||||
|         // Update cookie with new weapon. |  | ||||||
|         ZMarketSetRebuyCookie(client, slot, weapon); |  | ||||||
|          |  | ||||||
|         TranslationPrintToChat(client, "Weapons zmarket updated loadout"); |  | ||||||
|         return false; |  | ||||||
|     } |  | ||||||
|      |  | ||||||
|     // Set client's new cash after purchase. |  | ||||||
|     AccountSetClientCash(client, cash - itemprice); |  | ||||||
|      |  | ||||||
|     // Check to make sure the weapon isn't restricted. |     // Check to make sure the weapon isn't restricted. | ||||||
|     new bool:restricted = RestrictIsWeaponRestricted(weaponindex); |     new bool:restricted = RestrictIsWeaponRestricted(weaponindex); | ||||||
|     if (restricted) |     if (restricted) | ||||||
| @@ -819,6 +803,22 @@ stock bool:ZMarketEquip(client, const String:weapon[], bool:rebuy = false) | |||||||
|         return false; |         return false; | ||||||
|     } |     } | ||||||
|      |      | ||||||
|  |     // Get client's current money. | ||||||
|  |     new cash = AccountGetClientCash(client); | ||||||
|  |      | ||||||
|  |     // If client doesn't have enough money, tell them, resend menu, and then stop. | ||||||
|  |     if (cash < itemprice) | ||||||
|  |     { | ||||||
|  |         // Update cookie with new weapon. | ||||||
|  |         ZMarketSetRebuyCookie(client, slot, weapon); | ||||||
|  |          | ||||||
|  |         TranslationPrintToChat(client, "Weapons zmarket updated loadout"); | ||||||
|  |         return false; | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     // Set client's new cash after purchase. | ||||||
|  |     AccountSetClientCash(client, cash - itemprice); | ||||||
|  |      | ||||||
|     // Get a list of the client's current weapons. |     // Get a list of the client's current weapons. | ||||||
|     new weapons[WeaponsSlot]; |     new weapons[WeaponsSlot]; | ||||||
|     WeaponsGetClientWeapons(client, weapons); |     WeaponsGetClientWeapons(client, weapons); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user