import es
import gamethread

import wcs
from wcs import wcs

itemName = 'Helmet of Clear View'

wcs.Item(itemName).registerItem('defense', 4000, "This helmet protects your eyes from blinding flashbangs and reduces the effect by 50%", True)    
        
def player_flash(ev):
    es.setplayerprop(ev['userid'], "CCSPlayer.m_flFlashMaxAlpha", es.getplayerprop(ev['userid'], 'CCSPlayer.m_flFlashMaxAlpha') / 2 )
        
def player_death(ev):
    wcs.Command(ev['userid']).RemoveItem(itemName)
