adamdburton/pointshop — pull request #1 by Waterwolf (2012-12-06 14:51:23+00:00)
Title: Added SingleShipment variable to items

Allows items that can be bought for a single round.

Usage:
```lua
ITEM.SingleShipment = true -- When bought this item is given to you only once

function ITEM:VerifySingleShipment(ply) -- Controls whether or not player is allowed to buy the shipment
if ply:Alive() then return true end
return false, "You must be alive to buy this item!" -- Custom notifications can be provided as second argument if first one is false
end
```

An example item (single round Deagle for Trouble in Terrorist Town):
```lua
ITEM.Name = 'Deagle'
ITEM.Price = 150
ITEM.Model = 'models/weapons/w_pist_deagle.mdl'
ITEM.SingleShipment = true

function ITEM:OnEquip(ply, modifications)
ply:Give("weapon_zm_revolver")
end

function ITEM:VerifySingleShipment(ply)
local state = ply:Alive() and ply:IsTerror()
return state, "You are not alive!" -- Message only matters if state is false so we can do this
end
```