Advertisement
captmicro

Untitled

Sep 21st, 2011
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 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. for wep in weps:
  24. for index in wep.indexlist:
  25. handle = es.getindexprop(index, 'CBaseEntity.m_hOwnerEntity')
  26. surfround_weps[h2u[handle]] += [str(wep)]
  27.  
  28. def restore_weps():
  29. global surfround_weps
  30. weps = weaponlib.getWeaponList('#all')
  31. for wep in weps:
  32. for index in wep.indexlist:
  33. es.remove(index)
  34. for ply in playerlib.getPlayerList('#all'):
  35. weapons = surfround_weps[str(ply.userid)]
  36. for weapon in weapons:
  37. es.server.queuecmd('es_xgive %s %s' % ([ply.userid, weapon))
  38. surfround_wep.clear()
  39.  
  40. def surfround_endround():
  41. save_weps()
  42. surfround_timelimit = int(es.ServerVar('mp_roundtime')) * 60 - 6
  43. es.InsertServerCommand("mp_ignore_round_win_conditions 0")
  44. for ply in playerlib.getPlayerList('#all'):
  45. ply.kill()
  46. gamethread.delayed(surfround_timelimit, surfround_endround)
  47. es.InsertServerCommand("mp_ignore_round_win_conditions 1")
  48. gamethread.delayed(5, restore_weps)
  49.  
  50. def surfround_cmd(args):
  51. surfround_timelimit = int(args[0])
  52.  
  53. def load():
  54. es.InsertServerCommand("mp_ignore_round_win_conditions 1")
  55. surfround_timelimit = int(es.ServerVar('mp_roundtime')) * 60 - 6
  56. gamethread.delayed(surfround_timelimit, surfround_endround)
  57.  
  58. def unload():
  59. es.InsertServerCommand("mp_ignore_round_win_conditions 0")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement