def cmd_gift(self, data, client, cmd=None):
"""\
Gives a random player a gift
"""
m = self._adminPlugin.parseUserCmd(data)
if not m:
clients = random.choice(self.console.clients.getClientsByState(b3.STATE_ALIVE))
guy = clients.cid
gunList = ['punish give::' + guy + '::deserteagle', 'punish give::' + guy + '::deserteaglegold', 'punish give::' + guy + '::G3', 'punish give::' + guy + '::G36', 'punish give::' + guy + '::M4', 'punish give::' + guy + '::M16', 'punish give::' + guy + '::m40a3', 'punish give::' + guy + '::usp', 'punish give::' + guy + '::ak47', 'punish give::' + guy + '::mp5', 'punish give::' + guy + '::p90', 'punish give::' + guy + '::uzi', 'punish give::' + guy + '::remington700', 'punish give::' + guy + '::M60E4_reflex']
giftList = ['punish give::' + guy + '::deserteagle', random.choice(gunList)]
gun = random.choice(giftList)
client.message(gun)
self.console.write('%s' % (gun))
self.console.say('^2Merry ^1Christmas ^7%s' % (clients.exactName))
return False
sclient = self._adminPlugin.findClientPrompt(m[0], client)
if sclient:
guy = sclient.cid
gunList = ['punish give::' + guy + '::deserteagle', 'punish give::' + guy + '::deserteaglegold', 'punish give::' + guy + '::G3', 'punish give::' + guy + '::G36', 'punish give::' + guy + '::M4', 'punish give::' + guy + '::M16', 'punish give::' + guy + '::m40a3', 'punish give::' + guy + '::usp', 'punish give::' + guy + '::ak47', 'punish give::' + guy + '::mp5', 'punish give::' + guy + '::p90', 'punish give::' + guy + '::uzi', 'punish give::' + guy + '::remington700', 'punish give::' + guy + '::M60E4_reflex']
giftList = ['punish give::' + guy + '::deserteagle', random.choice(gunList)]
gun = random.choice(giftList)
client.message(gun)
self.console.write('%s' % (gun))
self.console.say('^2Merry ^1Christmas ^7%s' % (sclient.exactName))
this works it works if you want to type in a name or just keep it random