Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # written under the influcence of marijuana
- # BY: Capt. Micro
- # .
- # M
- # dM
- # MMr
- # 4MMML .
- # MMMMM. xf
- # . "MMMMM .MM-
- # Mh.. +MMMMMM .MMMM
- # .MMM. .MMMMML. MMMMMh
- # )MMMh. MMMMMM MMMMMMM
- # 3MMMMx. 'MMMMMMf xnMMMMMM"
- # '*MMMMM MMMMMM. nMMMMMMP"
- # *MMMMMx "MMMMM\ .MMMMMMM=
- # *MMMMMh "MMMMM" JMMMMMMP
- # MMMMMM 3MMMM. dMMMMMM .
- # MMMMMM "MMMM .MMMMM( .nnMP"
- # =.. *MMMMx MMM" dMMMM" .nnMMMMM*
- # "MMn... 'MMMMr 'MM MMM" .nMMMMMMM*"
- # "4MMMMnn.. *MMM MM MMP" .dMMMMMMM""
- # ^MMMMMMMMx. *ML "M .M* .MMMMMM**"
- # *PMMMMMMhn. *x > M .MMMM**""
- # ""**MMMMhx/.h/ .=*"
- # .3P"%....
- # nP" "*MMnx
- import es, playerlib, popuplib, weaponlib, usermsg
- info = es.AddonInfo()
- info.name = "MicroBuy"
- info.basename = "microbuy"
- info.version = "HERPDERPDURR"
- info.url = "microvnet.info"
- info.description= "SUP3R L33T BUY M3NU"
- info.author = "Capt. Micro"
- info.contact = "arrowflyer@gmail.com"
- info.tags = "buy,menu,weapons"
- microbuy_menu = None
- microbuy_items = {
- "weapon_glock":500,
- "weapon_usp":350,
- "weapon_deagal":1000,
- "weapon_fiveseven":500,
- "weapon_p228":500,
- "weapon_elite":1000,
- "weapon_mac10":800,
- "weapon_tmp":800,
- "weapon_mp5navy":1000,
- "weapon_ump45":1500,
- "weapon_p90":1000,
- "weapon_m3":2000,
- "weapon_xm1014":2000,
- "weapon_galil":1250,
- "weapon_famas":1250,
- "weapon_ak47":1250,
- "weapon_m4a1":1250,
- "weapon_sg552":1500,
- "weapon_aug":1500,
- "weapon_scout":2000,
- "weapon_g3sg1":2500,
- "weapon_sg550":2500,
- "weapon_awp":3500,
- "weapon_m249":2500,
- "weapon_hegrenade":300,
- "weapon_flashbang":300,
- "weapon_smokegrenade":300
- }
- def stripweapon(handle, indexlist):
- for index in indexlist:
- if (es.getindexprop(index, 'CBaseEntity.m_hOwnerEntity') == handle):
- es.remove(index)
- def stripslot(userid, slot):
- weps = weaponlib.getWeaponList('#all')
- handle = es.getplayerhandle(userid)
- for wep in weps:
- if (wep.slot == slot):
- stripweapon(handle, wep.indexlist)
- def menu_handler(userid, choice, menuname):
- info = choice.split(',')
- ply = playerlib.getPlayer(str(userid))
- price = int(info[1])
- if (ply.cash >= price):
- wepslot = weaponlib.getWeapon(info[0].split('_')[1]).slot
- stripslot(ply.userid, wepslot)
- es.server.queuecmd('es_xgive %s %s' % (userid, info[0]))
- ply.cash -= price
- def load():
- global microbuy_menu
- microbuy_menu = popuplib.easymenu('microbuy', None, menu_handler)
- microbuy_menu.settitle("MicroBuy")
- for item, price in microbuy_items.items():
- microbuy_menu.addoption("%s,%d"%(item,price),
- "%s [$%d]"%(item.split('_')[1],price))
- def es_player_chat(e):
- global microbuy_menu
- text = e['text']
- ply = playerlib.getPlayer(str(e['userid']))
- if (text[0:4] == '!buy'):
- microbuy_menu.send(ply.userid)
- elif (text[0:9] == '!announce'):
- args = e['text'].split(' ', 1)
- if (ply.cash >= 7500):
- usermsg.centermsg('#all', args[1])
- ply.cash -= 7500
- elif (text[0:5] == '!tele'):
- if (ply.cash >= 1):
- ply.cash -= 1
- es.setplayerprop(ply.userid,
- 'CCSPlayer.baseclass.localdata.m_vecBaseVelocity',
- '0,0,0')
- ply.setLocation((-1952.000000, 0, 7272.093750))
- def unload():
- global microbuy_menu
- microbuy_menu.delete()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement