Fixed dead players being able to get weapons.

This commit is contained in:
Richard Helgeby 2011-04-24 23:28:52 +02:00
parent f878dd5735
commit 64ce21b4e2

View File

@ -773,8 +773,8 @@ stock bool:ZMarketEquip(client, const String:weapon[], bool:rebuy = false)
// Get slot index of the weapon being purchased. // Get slot index of the weapon being purchased.
new WeaponsSlot:slot = WeaponsGetSlot(weaponindex); new WeaponsSlot:slot = WeaponsGetSlot(weaponindex);
// If client is a zombie, then update weapon loadout and stop. // If client is dead or a zombie, update weapon loadout instead.
if (InfectIsClientInfected(client)) if (!IsPlayerAlive(client) || InfectIsClientInfected(client))
{ {
// Update cookie with new weapon. // Update cookie with new weapon.
ZMarketSetRebuyCookie(client, slot, weapon); ZMarketSetRebuyCookie(client, slot, weapon);
@ -1098,6 +1098,13 @@ stock ZMarketSetRebuyCookie(client, WeaponsSlot:slot, const String:value[])
*/ */
ZMarketRebuy(client, bool:autorebuy = false) 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 client is a zombie, then stop.
if (InfectIsClientInfected(client)) if (InfectIsClientInfected(client))
{ {