Advertisement
captmicro

Untitled

Sep 21st, 2011
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. import es, cmdlib, playerlib, weaponlib, gamethread
  2.  
  3. info = es.AddonInfo()
  4. info.name = "Surf Round Time Limit Hax"
  5. info.basename = "surfround"
  6. info.version = "HERPDERPDURR"
  7. info.url = "microvnet.info"
  8. info.description= "SUP3R L33T 5URF"
  9. info.author = "Capt. Micro"
  10. info.contact = "arrowflyer@gmail.com"
  11. info.tags = "round,time,limit,weapons"
  12.  
  13. surfround_weps = {}
  14. surfround_timelimit = 0
  15.  
  16. def save_weps():
  17. global surfround_weps
  18. weps = weaponlib.getWeaponList('#all')
  19. h2u = {}
  20. for ply in playerlib.getPlayerList('#all'):
  21. handle = es.getplayerhandle(ply.userid)
  22. h2u[handle] = str(ply.userid)
  23. surfround_weps[str(ply.userid)] = []
  24. for wep in weps:
  25. for index in wep.indexlist:
  26. handle = es.getindexprop(index, 'CBaseEntity.m_hOwnerEntity')
  27. surfround_weps[h2u[handle]] += [wep.name]
  28.  
  29. def restore_weps():
  30. global surfround_weps
  31. weps = weaponlib.getWeaponList('#all')
  32. for wep in weps:
  33. for index in wep.indexlist:
  34. es.remove(index)
  35. for ply in playerlib.getPlayerList('#all'):
  36. weapons = surfround_weps[str(ply.userid)]
  37. for weapon in weapons:
  38. es.server.queuecmd('es_xgive %s %s' % (ply.userid, weapon))
  39. surfround_weps.clear()
  40.  
  41. def surfround_endround():
  42. save_weps()
  43. surfround_timelimit = int(es.ServerVar('mp_roundtime')) * 60 - 6
  44. es.InsertServerCommand("mp_ignore_round_win_conditions 0")
  45. for ply in playerlib.getPlayerList('#all'):
  46. ply.kill()
  47. gamethread.delayed(surfround_timelimit, surfround_endround)
  48. es.InsertServerCommand("mp_ignore_round_win_conditions 1")
  49. gamethread.delayed(5, restore_weps)
  50.  
  51. def surfround_cmd(args):
  52. surfround_timelimit = int(args[0])
  53.  
  54. def load():
  55. es.InsertServerCommand("mp_ignore_round_win_conditions 1")
  56. surfround_timelimit = int(es.ServerVar('mp_roundtime')) * 60 - 6
  57. gamethread.delayed(surfround_timelimit, surfround_endround)
  58.  
  59. def unload():
  60. es.InsertServerCommand("mp_ignore_round_win_conditions 0")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement