Advertisement
captmicro

Flashbangs Only EventScripts Python

Jun 16th, 2012
393
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.67 KB | None | 0 0
  1. import es, playerlib, weaponlib
  2.  
  3. info = es.AddonInfo()
  4. info.name       = "Flashbangs Only"
  5. info.basename   = "flashbangsonly"
  6. info.version    = "HERPDERPDURR"
  7. info.url        = "b0mbnet.info"
  8. info.description= "SUP3R L33T G4M3 M0D3!!!"
  9. info.author     = "Capt. Micro"
  10. info.contact    = "arrowflyer@gmail.com"
  11. info.tags       = "flash,bang,flashbang,only,gamemode,game,mode"
  12.  
  13. vip = [
  14.     "weapon_scout",
  15. ]
  16. ply = [
  17.     "weapon_flashbang", # give the player two
  18.     "weapon_flashbang", # you only get another when you hit someone
  19. ]
  20. g00nz = [
  21.     #"Capt. Micro",
  22.     #"Bomb Diggity",
  23. ]
  24.  
  25. def stripweapon(handle, indexlist):
  26.     for index in indexlist:
  27.         if (es.getindexprop(index, 'CBaseEntity.m_hOwnerEntity') == handle):
  28.                 es.remove(index)
  29.  
  30. def stripslot(userid, slot):
  31.     weps = weaponlib.getWeaponList('#all')
  32.     handle = es.getplayerhandle(userid)
  33.     for wep in weps:
  34.         if (wep.slot == slot):
  35.             stripweapon(handle, wep.indexlist)
  36.  
  37. def stripall(userid):
  38.     weps = weaponlib.getWeaponList('#all')
  39.     handle = es.getplayerhandle(userid)
  40.     for wep in weps:
  41.         stripweapon(handle, wep.indexlist)
  42.  
  43. def player_spawn(event_var):
  44.     player = playerlib.getPlayer(int(event_var['userid']))
  45.     stripall(player.userid)
  46.     try:
  47.         g00nz.index(player.name)
  48.         for itm in vip:
  49.             es.server.queuecmd('es_xgive %s %s' % (str(player.userid), itm))
  50.     except ValueError:
  51.         pass
  52.     for itm in ply:
  53.         es.server.queuecmd('es_xgive %s %s' % (str(player.userid), itm))
  54.     player.health = 1
  55.     player.armor = 0
  56.  
  57. def player_death(event_var):
  58.     if event_var['weapon'] == "weapon_flashbang":
  59.         es.server.queuecmd('es_xgive %s %s' % (str(event_var['attacker']), event_var['weapon']))
  60.  
  61. def load():
  62.     pass
  63.  
  64. def unload():
  65.     pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement