Fixed ZMarket auto-rebuy and removed debug message.
This commit is contained in:
		| @@ -250,7 +250,6 @@ VAmbienceApplySky(bool:disable = false) | |||||||
|     // If default, then set to default sky. |     // If default, then set to default sky. | ||||||
|     if (disable) |     if (disable) | ||||||
|     { |     { | ||||||
|         PrintToServer("+===============+++++ %s", g_VAmbienceDefaultSky); |  | ||||||
|         if (g_VAmbienceDefaultSky[0]) |         if (g_VAmbienceDefaultSky[0]) | ||||||
|         { |         { | ||||||
|             SetConVarString(hSkyname, g_VAmbienceDefaultSky, true); |             SetConVarString(hSkyname, g_VAmbienceDefaultSky, true); | ||||||
|   | |||||||
| @@ -136,7 +136,7 @@ ZMarketOnClientSpawn(client) | |||||||
|     // If auto-rebuy is enabled, then force client to rebuy weapons. |     // If auto-rebuy is enabled, then force client to rebuy weapons. | ||||||
|     if (g_bZMarketAutoRebuy[client]) |     if (g_bZMarketAutoRebuy[client]) | ||||||
|     { |     { | ||||||
|         ZMarketRebuy(client); |         ZMarketRebuy(client, true); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -525,7 +525,7 @@ stock bool:ZMarketEquip(client, const String:weapon[], bool:rebuy = false) | |||||||
|     } |     } | ||||||
|      |      | ||||||
|     new bool:zmarketbuyzone = GetConVarBool(g_hCvarsList[CVAR_WEAPONS_ZMARKET_BUYZONE]); |     new bool:zmarketbuyzone = GetConVarBool(g_hCvarsList[CVAR_WEAPONS_ZMARKET_BUYZONE]); | ||||||
|     if (zmarketbuyzone && !ZMarketIsClientInBuyZone(client)) |     if (!rebuy && zmarketbuyzone && !ZMarketIsClientInBuyZone(client)) | ||||||
|     { |     { | ||||||
|         TranslationPrintToChat(client, "Weapons zmarket buyzone"); |         TranslationPrintToChat(client, "Weapons zmarket buyzone"); | ||||||
|         return false; |         return false; | ||||||
| @@ -625,9 +625,12 @@ stock bool:ZMarketEquip(client, const String:weapon[], bool:rebuy = false) | |||||||
|         // Add 1 to the client's purchase count. |         // Add 1 to the client's purchase count. | ||||||
|         ZMarketSetPurchaseCount(client, weapon, 1, true); |         ZMarketSetPurchaseCount(client, weapon, 1, true); | ||||||
|          |          | ||||||
|  |         if (slot != Slot_Invalid && slot != Slot_Projectile) | ||||||
|  |         { | ||||||
|             // Tell client they bought a weapon. |             // Tell client they bought a weapon. | ||||||
|             TranslationPrintToChat(client, "Weapons zmarket purchase", weapon); |             TranslationPrintToChat(client, "Weapons zmarket purchase", weapon); | ||||||
|         } |         } | ||||||
|  |     } | ||||||
|     else if (!rebuy) |     else if (!rebuy) | ||||||
|     { |     { | ||||||
|         // Get ammo type and stop if it's invalid. |         // Get ammo type and stop if it's invalid. | ||||||
| @@ -652,7 +655,7 @@ stock bool:ZMarketEquip(client, const String:weapon[], bool:rebuy = false) | |||||||
|  *  |  *  | ||||||
|  * @param client    The client index. |  * @param client    The client index. | ||||||
|  */ |  */ | ||||||
| ZMarketRebuy(client) | ZMarketRebuy(client, bool:rebuy = false) | ||||||
| { | { | ||||||
|     // If client is a zombie, then stop. |     // If client is a zombie, then stop. | ||||||
|     if (InfectIsClientInfected(client)) |     if (InfectIsClientInfected(client)) | ||||||
| @@ -662,7 +665,7 @@ ZMarketRebuy(client) | |||||||
|     } |     } | ||||||
|      |      | ||||||
|     new bool:zmarketbuyzone = GetConVarBool(g_hCvarsList[CVAR_WEAPONS_ZMARKET_BUYZONE]); |     new bool:zmarketbuyzone = GetConVarBool(g_hCvarsList[CVAR_WEAPONS_ZMARKET_BUYZONE]); | ||||||
|     if (zmarketbuyzone && !ZMarketIsClientInBuyZone(client)) |     if (!rebuy && zmarketbuyzone && !ZMarketIsClientInBuyZone(client)) | ||||||
|     { |     { | ||||||
|         TranslationPrintToChat(client, "Weapons zmarket buyzone"); |         TranslationPrintToChat(client, "Weapons zmarket buyzone"); | ||||||
|         return; |         return; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user