I've been looking for Documentation on how to create a menu file for a multiplayer map, that basically executes a command in script to -attack and +activate. It pretty much takes the button pressed of attack away/off and presses the activate/use key on the players keyboard/game.
It doesn't change anything on the clients game, it just takes them off of a turret, in a nutshell. MP doesn't have the functions to do it without using a menu file. "Apparently" The problem is, there isn't any clear tutorials on how to use a menu file in this way.
Does anyone know how I can do this?
I will paste a few code snippets that are required along with the method I started working in. I just can't seem to get it to work.
I have the menu precache in my main maps .gsc file, before any wait functions.
game["menu_clientcmd"] = "clientcmd";
Here is the line that calls the method.
player thread execClientCommand("-attack; +activate; wait 10; -activate");
Here is the method I started working in. The method fires, but it never kicks the player off the turret. Which pretty much says that the menu file isn't working. However, I do see a mouse pointer where my crosshairs are and my minimap flickers, so I guess the menu file is working but not executing the commands I have for input.
self setClientDvar("clientcmd", cmd);
// self closeMenu("menu_clientcmd");
IPrintLn( "Vars: " + cmd);
Here is the menu file I created. No idea if I did it properly or not though. Named it: menu_clientcmd.menu
The problem is, I don't know what is supposed to be in the menu file. Some people said, this is all I need, but looking at what's in it, it makes absolutely no sense on how that can even work. Plus, I don't know what " #include "ui_mp/menudef.h
" is trying to reference, because in that file, it doesn't really tell me anything. If I include it, the compiler throws an error saying it can't find the file, which makes sense because technically, it doesn't exist in that current path. So, I made a copy, put it in the path defined in the menu file, and then added it as a raw file to my zone file. lol! No idea here.
rect 0 0 1 1
exec "vstr clientcmd";
Also referenced it in my zone file.
If anyone can help me figure this out. Does anyone know how to do this properly or have a tutorial I can reference that is complete. Would help out greatly. Am I missing something obvious??