Advertisement
captmicro

Untitled

Sep 19th, 2011
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.56 KB | None | 0 0
  1. # written under the influcence of marijuana
  2. # BY: Capt. Micro
  3. # .
  4. # M
  5. # dM
  6. # MMr
  7. # 4MMML .
  8. # MMMMM. xf
  9. # . "MMMMM .MM-
  10. # Mh.. +MMMMMM .MMMM
  11. # .MMM. .MMMMML. MMMMMh
  12. # )MMMh. MMMMMM MMMMMMM
  13. # 3MMMMx. 'MMMMMMf xnMMMMMM"
  14. # '*MMMMM MMMMMM. nMMMMMMP"
  15. # *MMMMMx "MMMMM\ .MMMMMMM=
  16. # *MMMMMh "MMMMM" JMMMMMMP
  17. # MMMMMM 3MMMM. dMMMMMM .
  18. # MMMMMM "MMMM .MMMMM( .nnMP"
  19. # =.. *MMMMx MMM" dMMMM" .nnMMMMM*
  20. # "MMn... 'MMMMr 'MM MMM" .nMMMMMMM*"
  21. # "4MMMMnn.. *MMM MM MMP" .dMMMMMMM""
  22. # ^MMMMMMMMx. *ML "M .M* .MMMMMM**"
  23. # *PMMMMMMhn. *x > M .MMMM**""
  24. # ""**MMMMhx/.h/ .=*"
  25. # .3P"%....
  26. # nP" "*MMnx
  27.  
  28. import es, playerlib, popuplib, weaponlib, usermsg
  29.  
  30. info = es.AddonInfo()
  31. info.name = "MicroBuy"
  32. info.basename = "microbuy"
  33. info.version = "HERPDERPDURR"
  34. info.url = "microvnet.info"
  35. info.description= "SUP3R L33T BUY M3NU"
  36. info.author = "Capt. Micro"
  37. info.contact = "arrowflyer@gmail.com"
  38. info.tags = "buy,menu,weapons"
  39.  
  40. microbuy_menu = None
  41. microbuy_items = {
  42. "weapon_glock":500,
  43. "weapon_usp":350,
  44. "weapon_deagal":1000,
  45. "weapon_fiveseven":500,
  46. "weapon_p228":500,
  47. "weapon_elite":1000,
  48.  
  49. "weapon_mac10":800,
  50. "weapon_tmp":800,
  51. "weapon_mp5navy":1000,
  52. "weapon_ump45":1500,
  53. "weapon_p90":1000,
  54.  
  55. "weapon_m3":2000,
  56. "weapon_xm1014":2000,
  57.  
  58. "weapon_galil":1250,
  59. "weapon_famas":1250,
  60. "weapon_ak47":1250,
  61. "weapon_m4a1":1250,
  62. "weapon_sg552":1500,
  63. "weapon_aug":1500,
  64.  
  65. "weapon_scout":2000,
  66. "weapon_g3sg1":2500,
  67. "weapon_sg550":2500,
  68. "weapon_awp":3500,
  69.  
  70. "weapon_m249":2500,
  71. "weapon_hegrenade":300,
  72. "weapon_flashbang":300,
  73. "weapon_smokegrenade":300
  74. }
  75.  
  76. def stripweapon(handle, weapon, indexlist):
  77. handle = es.getplayerhandle(userid)
  78. for index in indexlist:
  79. if (es.getindexprop(index, 'CBaseEntity.m_hOwnerEntity') == handle):
  80. es.remove(index)
  81.  
  82. def stripslot(userid, slot):
  83. weps = weaponlib.getWeaponList('#all')
  84. handle = es.getplayerhandle(userid)
  85. for wep in weps:
  86. if (wep.slot == slot):
  87. stripweapon(handle, wep.indexlist)
  88.  
  89. def menu_handler(userid, choice, menuname):
  90. info = choice.split(',')
  91. ply = playerlib.getPlayer(str(userid))
  92. price = int(info[1])
  93. if (ply.cash >= price):
  94. wepslot = weaponlib.getWeapon(info[0].split('_')[1]).slot
  95. stripslot(ply.userid, wepslot)
  96. es.server.queuecmd('es_xgive %s %s' % (userid, info[0]))
  97. ply.cash -= price
  98.  
  99. def load():
  100. global microbuy_menu
  101. microbuy_menu = popuplib.easymenu('microbuy', None, menu_handler)
  102. microbuy_menu.settitle("MicroBuy")
  103. for item, price in microbuy_items.items():
  104. microbuy_menu.addoption("%s,%d"%(item,price),
  105. "%s [$%d]"%(item.split('_')[1],price))
  106.  
  107. def es_player_chat(e):
  108. global microbuy_menu
  109. text = e['text']
  110. ply = playerlib.getPlayer(str(e['userid']))
  111. if (text[0:4] == '!buy'):
  112. microbuy_menu.send(ply.userid)
  113. elif (text[0:9] == '!announce'):
  114. args = e['text'].split(' ', 1)
  115. if (ply.cash >= 7500):
  116. usermsg.centermsg('#all', args[1])
  117. ply.cash -= 7500
  118. elif (text[0:5] == '!tele'):
  119. if (ply.cash >= 100):
  120. ply.cash -= 100
  121. ply.setLocation((-1952.000000, 0, 7272.093750))
  122.  
  123. def unload():
  124. global microbuy_menu
  125. microbuy_menu.delete()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement