Advertisement
captmicro

Untitled

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