Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds
Watch MODSonair

Members Online

»
0 Active | 49 Guests
Online:

LATEST FORUM THREADS

»
SOF2 Prefabs map
SoFII Mapping
coduo mapping tools
CoDUO Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 MP Mapping
CoD 4 mapping and level design for multiplayer.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Creating a Menu file for MP (setClientDvar) -attack; +activate;
DeekCiti
General Member
Since: Mar 12, 2008
Posts: 1293
Last: Jul 8, 2016
[view latest posts]
Level 8
Category: CoD4 MP Mapping
Posted: Saturday, Apr. 18, 2015 12:45 am
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.

Code:

	game["menu_clientcmd"] = "clientcmd";
	precacheMenu(game["menu_clientcmd"]);



Here is the line that calls the method.

Code:

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.

Code:

execClientCommand(cmd)
{
	self setClientDvar("clientcmd", cmd);
	self openMenu(game["menu_clientcmd"]);
//	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.

Code:

#include "ui_mp/menudef.h"

{
    menuDef 
    {
        name		"clientcmd"
        rect		0 0 1 1
        visible		0
        fullscreen	0

        onOpen 
        { 
            exec "vstr clientcmd"; 
            close clientcmd;
        } 
    }
}



Also referenced it in my zone file.

Code:

menufile,ui_mp/scriptmenus/menu_clientcmd.menu


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??
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 MP Mapping

Latest Syndicated News

»
thank you cards
ForeverFiances is an Eco Friendly Stationary Since 2008. Premium quality sta...
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»