Advertisement
captmicro

Untitled

Sep 21st, 2011
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 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 = 9
  15.  
  16. def save_weps():
  17. global surfround_weps
  18. weps = weaponlib.getWeaponList('#all')
  19. for wep in weps:
  20. for index in wep.indexlist:
  21. surfround_weps[es.getuserid(es.getindexprop(index,
  22. 'CBaseEntity.m_hOwnerEntity'))] += [str(wep)]
  23.  
  24. def restore_weps():
  25. global surfround_weps
  26. weps = weaponlib.getWeaponList('#all')
  27. for wep in weps:
  28. for index in wep.indexlist:
  29. es.remove(index)
  30. for ply in playerlib.getPlayerList('#all'):
  31. weapons = surfround_weps[ply.userid]
  32. for weapon in weapons:
  33. es.server.queuecmd('es_xgive %s %s' % (userid, weapon))
  34. surfround_wep.clear()
  35.  
  36. def surfround_endround():
  37. save_weps()
  38. es.InsertServerCommand("mp_ignore_round_win_conditions 0")
  39. gamethread.delayed(surfround_timelimit, surfround_endround)
  40. es.InsertServerCommand("mp_ignore_round_win_conditions 1")
  41. gamethread.delayed(5, restore_weps)
  42.  
  43. def surfround_cmd(args):
  44. surfround_timelimit = int(args[0])
  45.  
  46. def load():
  47. cmdlib.registerSayCommand('surfround_timelimit', surfround_cmd, 'Set round time limit (minutes)')
  48. es.InsertServerCommand("surfround_timelimit %d" % surfround_timelimit) #initial limit
  49. es.InsertServerCommand("mp_ignore_round_win_conditions 1")
  50. gamethread.delayed(surfround_timelimit, surfround_endround)
  51.  
  52. def unload():
  53. es.InsertServerCommand("mp_ignore_round_win_conditions 0")
  54. cmdlib.unregisterServerCommand('surfround_timelimit')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement