I am posting this actually for a friend of mine who wants to know what is wrong with his script.
It is meant to be a command like !gun m40a3, and then that it gives yourself a gun.
Normally you need to add a name like !gun Rico m40a3, but that's what we want to remove. So you can't give it to other people.
here is the script for it:
Code: Select all
ef cmd_give(self, data, client, cmd=None):
        """\
        <player> <gun> - Give a player a weapon
        """
        m = self._adminPlugin.parseUserCmd(data)
        if not m:
            client.message('^7Invalid parameters')
            return False
        if not m[1]:
            client.message('^7Invalid parameters')
            return False
        sclient = self._adminPlugin.findClientPrompt(m[0], client)
        if sclient:
            self.console.write('punish give::sclient::%s::yes' % (sclient.cid, m[1]))
            sclient.message('^1 %s, ^3You were blessed by the Gods, and been given guns!' % (sclient.exactName))
        else:
            client.message('Player not found')
Thanks,
Rico