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.
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))
{