Raised This Month: $32 Target: $400
 8% 

[REQ][CS:GO] Re Code Eventscript plugin in sourcemod


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shyriu42
Member
Join Date: Dec 2009
Old 09-30-2012 , 19:16   [REQ][CS:GO] Re Code Eventscript plugin in sourcemod
Reply With Quote #1

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')
shyriu42 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode