Advertisement
captmicro

Untitled

Sep 18th, 2011
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.65 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(userid, weapon):
  77. handle = es.getplayerhandle(userid)
  78. entlist = es.createentitylist()
  79. for index in entlist:
  80. if (entlist[index]['classname'] == weapon):
  81. if (es.getindexprop(index, 'CBaseEntity.m_hOwnerEntity') == handle):
  82. es.remove(index)
  83.  
  84. def stripslot(userid, slot):
  85. weps = weaponlib.getWeaponList('#all')
  86. for wep in weps:
  87. if (wep.slot == slot):
  88. stripweapon(userid, wep.name)
  89.  
  90. def menu_handler(userid, choice, menuname):
  91. info = choice.split(',')
  92. ply = playerlib.getPlayer(str(userid))
  93. price = int(info[1])
  94. if (ply.cash >= price):
  95. wepslot = weaponlib.getWeapon(info[0].split('_')[1]).slot
  96. stripslot(ply.userid, wepslot)
  97. es.server.queuecmd('es_xgive %s %s' % (userid, info[0]))
  98. ply.cash -= price
  99.  
  100. def load():
  101. global microbuy_menu
  102. microbuy_menu = popuplib.easymenu('microbuy', None, menu_handler)
  103. microbuy_menu.settitle("MicroBuy")
  104. for item, price in microbuy_items.items():
  105. microbuy_menu.addoption("%s,%d"%(item,price),
  106. "%s [$%d]"%(item.split('_')[1],price))
  107.  
  108. def es_player_chat(e):
  109. global microbuy_menu
  110. text = e['text']
  111. ply = playerlib.getPlayer(str(e['userid']))
  112. if (text[0:4] == '!buy'):
  113. microbuy_menu.send(ply.userid)
  114. elif (text[0:9] == '!announce'):
  115. args = e['text'].split(' ', 1)
  116. if (ply.cash >= 7500):
  117. usermsg.centermsg('#all', args[1])
  118. ply.cash -= 7500
  119. elif (text[0:5] == '!tele'):
  120. if (ply.cash >= 100):
  121. ply.cash -= 100
  122. ply.setLocation((-1952.000000, 0, 7272.093750))
  123. es.server.queuecmd('es_xsetang %s %d %d %d' % (userid, 0, 0, 0))
  124.  
  125. def unload():
  126. global microbuy_menu
  127. microbuy_menu.delete()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement