Thread: Send a console command to the server

Results 1 to 11 of 11
  1. #1
    Not in the circlejerk S. H. Lynx's Avatar
    Join Date
    Sep 2009
    Location
    Santiago, Chile
    Posts
    186

    Send a console command to the server

    As the title implies I want to know if there's a method that allows me to send a String to the server's console.

    Thanks in Advance.

    Servidor Hispano de Sven Co-op

    Current HN: Luces en Babel / Babylon (Steam) - I no longer use S. H. Lynx on my work.
    SteamID

  2. #2
    Registered User
    Join Date
    Jan 2016
    Posts
    23

    Re: Send a console command to the server

    There doesn't seem to be a way, I can't find anything in the docs. Possibly made like so to protect servers from malicious plugins.

  3. #3
    incognico nico's Avatar
    Join Date
    Aug 2015
    Posts
    436

    Re: Send a console command to the server

    rcon_password <the password>
    rcon <command>

  4. #4
    Registered User
    Join Date
    Jan 2016
    Posts
    23

    Re: Send a console command to the server

    Quote Originally Posted by nico View Post
    rcon_password <the password>
    rcon <command>
    I believe he wants to do it from an AS plugin, not the console. Why else would he be in the AS Helpdesk forum?

  5. #5
    incognico nico's Avatar
    Join Date
    Aug 2015
    Posts
    436

    Re: Send a console command to the server

    Quote Originally Posted by KliPPy View Post
    I believe he wants to do it from an AS plugin, not the console. Why else would he be in the AS Helpdesk forum?
    Oh sorry, didn't see this was in the Angelscript section.

    There is "rcon as_command <cmd>" though.

  6. #6
    Registered User
    Join Date
    Jan 2016
    Posts
    23

    Re: Send a console command to the server

    Quote Originally Posted by nico View Post
    Oh sorry, didn't see this was in the Angelscript section.

    There is "rcon as_command <cmd>" though.
    That still requires player input. enginefuncs_t structure originally contains a pfnServerCommand function pointer, but looks like it isn't included in the AngelScript API for security reasons. Unless there is some alternative (most likely not) which I am not able to find in the docs.

  7. #7
    Banned Solokiller's Avatar
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    3,314

    Re: Send a console command to the server

    Which commands are you trying to execute?

  8. #8
    Not in the circlejerk S. H. Lynx's Avatar
    Join Date
    Sep 2009
    Location
    Santiago, Chile
    Posts
    186

    Re: Send a console command to the server

    Any, really, anything that can be input in the console.

    I guess if there's no method I'll have to use g_EngineFuncs.CVarSetFloat("[COMMAND]", 0); and hope it will work. (or CVarSetString if such method exists)

    Servidor Hispano de Sven Co-op

    Current HN: Luces en Babel / Babylon (Steam) - I no longer use S. H. Lynx on my work.
    SteamID

  9. #9
    Banned Solokiller's Avatar
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    3,314

    Re: Send a console command to the server

    Which commands, specifically? This function was not exposed to prevent plugins from changing things they shouldn't. If you have need for specific commands, the function can be exposed with a whitelist of allowed commands.

  10. #10
    Registered User Mr.angry's Avatar
    Join Date
    Jul 2007
    Location
    California
    Posts
    9

    Re: Send a console command to the server

    Being able to exec cfg files would be nice.

  11. #11
    Registered User tridz's Avatar
    Join Date
    Jan 2016
    Location
    Istanbul,Turkey
    Posts
    63

    Re: Send a console command to the server

    Sorry I dont understand.
    What is the difference between using rcon command and an angelscript sending the command?
    Is it really necessary??
    Also you can exec cfg files using rcon exec configname.
    I think I am missing something

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •