Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
January Donations
MordyT USD25.00
Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here

NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

Author Topic: Rcon commands with custom plugin  (Read 2638 times)

Offline EvoloZz

  • Jr. Member
  • **
  • Posts: 18
Rcon commands with custom plugin
« on: February 11, 2013, 09:06:59 PM »
Hello all, ive been working some days on my own plugin, but i found it easier if i write the script in CoD2 and then make a command for it (because i am cod2 modder). So the question was how do i execute a rcon command via registered b3 command?
Hopin for answers :D

Offline ozon

  • Full Member
  • ***
  • Posts: 107
    • GitHub
Re: Rcon commands with custom plugin
« Reply #1 on: February 11, 2013, 10:03:32 PM »
Yyou can fire up rcon commands with
Code: python [Select]
self.console.write(('YOUR_RCON_COMMAND', your_parameter))

You can create B3 command with
Code: python [Select]
def onStartup(self):
    # get the admin plugin so we can register commands
    self._adminPlugin = self.console.getPlugin('admin')
    if not self._adminPlugin:
        # something is wrong, can't start without admin plugin
        self.error('Could not find admin plugin')
    # Register commands
    self._adminPlugin.registerCommand(self, 'my-command', 2, self.my_command_func)
def my_command_func(self,  data, client, cmd):
    self.console.write(('YOUR_RCON_COMMAND', your_parameter))


Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4883
    • Github repository
Re: Rcon commands with custom plugin
« Reply #2 on: February 11, 2013, 10:18:04 PM »
for games based on the quake3 engine (this includes all cod games) you can send a rcon command just with :
Code: python [Select]
self.console.write('my_rcon_command foo')  [/quote]

Offline NK|Moh

  • Newbie
  • *
  • Posts: 6
Re: Rcon commands with custom plugin
« Reply #3 on: November 29, 2015, 11:10:48 AM »
hello i what to know how to make this code work !jump = self.console.write('g_gravity 45')  [/quote]  using a [/size][/color]plugin_customcommands or not i have plugin_customcommands but i dont know how can i make !jump = self.console.write('g_gravity 45')  [/quote] [/size][/color]
Thank you for help.
« Last Edit: November 29, 2015, 11:14:02 AM by NK|Moh »


Rate this page +1 at Google Search