B3 give self command

Have a question about modding, modelling or skinning? Have a tutorial to post? Post here!

Moderator: Core Staff

Post Reply
Dr.Rico
CJ Wannabe
CJ Wannabe
Posts: 15
Joined: December 11th, 2011, 1:17 pm
Gamertag: -
PSN ID: -
Location: The Netherlands

B3 give self command

Post by Dr.Rico » April 8th, 2012, 1:51 pm

Hi guys,

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')
Anyone an idea of what is wrong with it, please reply than :)

Thanks,
Rico

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: B3 give self command

Post by Drofder2004 » April 8th, 2012, 3:47 pm

Error messages?
Language used?
What information is being sent to the function?
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Dr.Rico
CJ Wannabe
CJ Wannabe
Posts: 15
Joined: December 11th, 2011, 1:17 pm
Gamertag: -
PSN ID: -
Location: The Netherlands

Re: B3 give self command

Post by Dr.Rico » April 8th, 2012, 3:57 pm

python is used,

error message you don't get, because b3 just won't start if one of the commands is wrong installed.

Dr.Rico
CJ Wannabe
CJ Wannabe
Posts: 15
Joined: December 11th, 2011, 1:17 pm
Gamertag: -
PSN ID: -
Location: The Netherlands

Re: B3 give self command

Post by Dr.Rico » April 9th, 2012, 10:40 am

Problem solved,

Thx anyway for the reply!

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests