Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Request Exec file.cfg from the server?
#1
Exclamation 
Hello, maybe anyone here already did that with success, or maybe could help me find the function which is called when you input a command at console to let us for exemple execute a command via script.

I'm looking for this for COD4, but I believe is the same in MW2 and MW3.

for exemple...

stargame()
{
...
run_at_console(exec config.cfg);
...
}

this UNKNOW (run_at_console) function exist somewhere in the part of the code not available in the modtools files, probably is inside some of these files (includes) which we don't have.

In Quake 2 Source engine this is the real function with real code:

Cbuf_ExecuteText(EXEC_NOW, "exec file.cfg");

everything that you sent to this function, is like as someone submitting this code direct on the server's console.

I used a lot in my old mods, and I'm really in need for this in my new version of Frontlines. Any Clues?

I know many of you here did amazing work reversing MW2 and other games, you could just take a look and find that function for me?

thank you
Hajas M0Ds | www.mods.hajas.org
Reply

#2
Hey Hajas, good to see you're still around!

There's no way to execute a client command out of the box in cod4, but there is a 'hacky' way.
You'll need a scriptmenu (make sure to precache it)
clientcmd.menu:
Code:
#include "ui/menudef.h"

{
    menuDef
    {
        name "clientcmd"
        rect 0 0 1 1
        visible 0
        fullscreen 0
    
        onOpen
        {
            exec "vstr clientcmd";
            close clientcmd;
        }
    }
}

Then in script, you'll need a function something like this:
Code:
execute_client(cmd) {
    self setclientdvar("clientcmd", cmd);
    wait 0.25; // Wait a little while for the dvar to actually be set
    self openmenunomouse(game["menu_clientcmd"]);
}
Forgive me if this isn't 100% syntactically correct, I haven't done this in a while Tongue

Good luck!
[Image: MaEIQ.png]
Reply

#3
Yeah! I'm using this for many yearsbut to use this we need someone at the server, tryed with even witha bot and didn't work.

We just need to find the function like I said above. we need to open the exe (or some. FF file) and try to find the function used whensend commands to the console.

I bet is something similar with the same function on quake 2 engine.

It's already there and working, we just need to find it.

The guys Who created any of mw2 servers might have look into it, or could take a look for us.

This function it's very important, it's a shame not be available with modtools.

Thanks for the reply. Big Grin
Hajas M0Ds | www.mods.hajas.org
Reply

#4
Oh, sorry, looks like I misunderstood your question. I would recommend asking the Cod4x guys. https://cod4x.me/

They already added some other script commands, https://github.com/callofduty4x/CoD4x_Se...ference.md
[Image: MaEIQ.png]
Reply



Forum Jump:


Users browsing this thread:
3 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.