Advertisement
captmicro

Untitled

Sep 18th, 2011
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.93 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
  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 menu_handler(userid, choice, menuname):
  77.     info = choice.split(',')
  78.     ply = playerlib.getPlayer(str(userid))
  79.     price = int(info[1])
  80.     if (ply.cash >= price):
  81.         es.server.queuecmd('es_xgive %s %s' % (userid, info[0]))
  82.         ply.cash -= price
  83.  
  84. def load():
  85.     global microbuy_menu
  86.     microbuy_menu = popuplib.easymenu('microbuy', None, menu_handler)
  87.     microbuy_menu.settitle("MicroBuy")
  88.     for item, price in microbuy_items.items():
  89.         microbuy_menu.addoption("%s,%d"%(item,price),
  90.         "%s [$%d]"%(item.split('_')[1],price))
  91.  
  92. def es_player_chat(e):
  93.     global microbuy_menu
  94.     text = e['text']
  95.     ply = playerlib.getPlayer(str(userid))
  96.     if (text[0:4] == '!buy'):
  97.         microbuy_menu.send(ply.userid)
  98.     elif (text[0:8] == '!announce'):
  99.         args = e['text'].split(' ', 1)
  100.         price = 7500
  101.         if (ply.cash >= price):
  102.             es.centermsg(args[1])
  103.             ply.cash -= price
  104.  
  105. def unload():
  106.     global microbuy_menu
  107.     microbuy_menu.delete()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement