Fixed ZMarket auto-rebuy and removed debug message.

This commit is contained in:
Greyscale 2009-06-16 11:51:34 -07:00
parent 23cc030dd5
commit ec231ba66a
2 changed files with 9 additions and 7 deletions

View File

@ -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);

View File

@ -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;