From 64ce21b4e2015305801b5264c652fa2d6c9a78ec Mon Sep 17 00:00:00 2001 From: Richard Helgeby Date: Sun, 24 Apr 2011 23:28:52 +0200 Subject: [PATCH] Fixed dead players being able to get weapons. --- src/zr/weapons/zmarket.inc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/zr/weapons/zmarket.inc b/src/zr/weapons/zmarket.inc index a280525..9bda554 100644 --- a/src/zr/weapons/zmarket.inc +++ b/src/zr/weapons/zmarket.inc @@ -773,8 +773,8 @@ stock bool:ZMarketEquip(client, const String:weapon[], bool:rebuy = false) // Get slot index of the weapon being purchased. new WeaponsSlot:slot = WeaponsGetSlot(weaponindex); - // If client is a zombie, then update weapon loadout and stop. - if (InfectIsClientInfected(client)) + // If client is dead or a zombie, update weapon loadout instead. + if (!IsPlayerAlive(client) || InfectIsClientInfected(client)) { // Update cookie with new weapon. ZMarketSetRebuyCookie(client, slot, weapon); @@ -1098,6 +1098,13 @@ stock ZMarketSetRebuyCookie(client, WeaponsSlot:slot, const String:value[]) */ ZMarketRebuy(client, bool:autorebuy = false) { + // If client is dead, then stop. + if (!IsPlayerAlive(client)) + { + TranslationPrintToChat(client, "Must be alive"); + return; + } + // If client is a zombie, then stop. if (InfectIsClientInfected(client)) {