hello try to have help again ...
i have this code in ES i would like to translate it in SM
this plugin forbids flash and awp until the bomb is down or planted
if someone can transform it in SM it will be great ....
Quote:
import es
def load():
es.addons.registerTickListener(TickListenerCa llBack)
def unload():
es.addons.unregisterTickListener(TickListener CallBack)
def TickListenerCallBack():
if es.getindexprop(es.getentityindex('cs_player_ manager'), 'CCSPlayerResource.m_iPlayerC4'):
for userid in es.getUseridList():
if not es.getplayerprop(userid, 'CBasePlayer.pl.deadflag'):
weapon = getWeaponActive(userid)
if weapon and weapon[7:] in ('flashbang', 'awp'):
if weapon[7:] == 'flashbang':
es.setplayerprop(userid, 'CCSPlayer.baseclass.baseclass.bcc_localdata. m_flNextAttack',
es.getplayerprop(userid, 'CCSPlayer.baseclass.baseclass.bcc_localdata. m_flNextAttack') + 1)
elif weapon[7:] == 'awp':
es.setplayerprop(userid, 'CBaseCombatCharacter.m_hActiveWeapon', -1)
es.cexec(userid, 'lastinv')
es.setplayerprop(userid, 'CCSPlayer.baseclass.baseclass.bcc_localdata. m_flNextAttack',
es.getplayerprop(userid, 'CCSPlayer.baseclass.baseclass.bcc_localdata. m_flNextAttack') + 1)
def getWeaponActive(userid):
return es.entitygetvalue(es.getindexfromhandle(es.ge tplayerprop(userid, 'CBaseCombatCharacter.m_hActiveWeapon')), 'classname')
|