Advertisement
captmicro

Untitled

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