oschigamer (01-14-2016),Scoudem (01-15-2016)
Here is an easy code to activate the external console. For some reason the game doesn't write anything to it, but it works just fine for executing commands, setting dvars etc.
Note: You should only call this once. If you don't have a hook where you can call it, create a new thread with a message queue and call it there. The cool thing about that approach is that the game won't exit if you close the console.Code:void (__cdecl* Sys_ShowConsole)() { reinterpret_cast<decltype(Sys_ShowConsole)>(0x005CB490) }; //somewhere in your hook static bool showConsole { true }; if (showConsole) { Sys_ShowConsole(); showConsole = false; }
Greetings!
Last edited by gerherhtherherdhher; 01-14-2016 at 10:58 PM.
oschigamer (01-14-2016),Scoudem (01-15-2016)
I've been struggling with that sub. Called it but the window just flashed by. Your method seems to work, thanks! Can I use it in my tool?
So does this allow you to put in certain DVARS and not others? Since apparently things like "map mp_afghan" won't work or w/e.
Hey, I can't get this to work, debugged it in win32project dll. No errors on build or on injection, just does nothing.
// ConsoleApplication5.cpp : Defines the exported functions for the DLL application.
#include "stdafx.h"
#include "Windows.h"
int Sys_ShowConsole()
{
void (__cdecl* Sys_ShowConsole)(); { reinterpret_cast<decltype(Sys_ShowConsole)>(0x005C B490) ;}
Sys_ShowConsole();
};
I fixed that, now their is some other errors :u
And where do you put this code please?
It's not a good idea to name the pointer and your function the same. You might get into an infinite recursion. Also, the game won't magically call your function, you have to create a thread from DllMain and create a message queue or hook into the game's thread and call it the
What errors?
In a text file, rename it to IW4Console.bat, then inject that into svchost.exe.
[NEWACCOUNT]Yano (05-05-2016)