ETMods.net

N!tmod, a Wolfenstein: Enemy Territory Modification!

You are not logged in.

Announcement

You can donate to help us keeping services online.

#1 30-Oct-12 11:51:19

Megadeth
Member
Registered: 27-Jul-12
Posts: 24

General Question/Support

Hey guys.
So I've installed Nitmod on my 24 slot server again yesterday after previously changing it to Jaymod for a while.
Since changing to Nitmod I was thinking of making a custom pk3 with custom menu options for the following:

> Clan forum
> Server rules
> Clan Servers
> Nitmod options

I am unsure of how I would go about to making the custom menu options for both the main menu and in-game menu, so I was wondering if anyone with some expierience could maybe point me in the right direction?

Also, I have made a custom command to make either myself or clan members a shoutcaster without having to do /sclogin.
I'm not sure if this has been done correctly or not:

command = makesc
exec = /sclogin ****
desc = Makes you shoutcaster without having to type /sclogin
levels = 9 10 11 12 13 14 15

Could someone please tell me if I have done this right or not?

And finally.
I was hoping to get Enhmod working with Nitmod, the server is running Nitmod 2.2 final and I have read somewhere that Enhmod would work on Nitmod as well as Jaymod but haven't tried it out yet, and the reason I would like to do this is to add new bot commands because the custom bot commands in the commands.db doesn't seem to work.
If Enhmod does work on Nitmod then what version of Enhmod would I have to get/install?

Offline

#2 30-Oct-12 13:56:51

N!trox*
Administrator
Registered: 30-Mar-10
Posts: 1,090

Re: General Question/Support

Hi,

MENUS:

Look at the ui/options.menu file for exemple, it's used by both ui/main.menu and ui/ingame_main.menu files.

For exemple:

menuDef {
    name        "options"
    visible        0
    fullscreen    0
    rect        WINDOW_X WINDOW_Y WINDOW_WIDTH WINDOW_HEIGHT
    style        WINDOW_STYLE_FILLED
   
    onESC {
        close options ;
#ifdef FUI
        open main
#else
        open ingame_main
#endif // FUI
    }

The #ifdef/else/endif can be used if u want to use the same menu file but perform different actions depending on which menu you're currently in.

#ifdef FUI = IF we are in the main menu
else = else... ^^
#endif = end of the #ifdef FUI condition

By looking at the 3 files mentionned here, you should be able to understand how to use the same menus for both game and ingame menus.


CUSTOM COMMANDS:

Custom commands are executed on the server, actually it's exactly the same as using "/rcon password cmd args" except it's safer cuz you don't need the rcon password to do this.

"sclogin" is a client command, that's the reason why it doesn't work.

If you add a "/" in front of the command, it will not work either.

Fortunately, N!tmod has a "makesc" server console command, so all you need to do is change:

exec = /sclogin ****

to

exec = makesc [n]

The [n] will automaticly be replaced by the name of the player who used the command. (see g_shortcuts)

You can also use this little LUA script to automaticly grant shoutcaster status to players with the required level.

I made this script for my test server and it works perfectly.

autosc.lua:

-- Auto Shoutcaster/Referee status
-- LUA by N!trox*
-- November 21st 2011
-- Called on ClientBegin
-- Automaticly grants shoutcaster and/or referee status to players with the specified levels

MODNAME = "Auto Shoutcaster"
MODVERSION = "1.0"

AUTO_SHOUTCASTER 	= 1
AUTO_REFEREE 		= 1

MIN_SHOUTCASTER_LEVEL 	= 3
MIN_REFEREE_LEVEL 	= 4

function et_InitGame(leveltime, randomseed, restart)
	et.RegisterModname(string.format("%s %s", MODNAME, MODVERSION));
end

function et_ClientBegin(clientNum)
	name = et.Q_CleanStr(et.Info_ValueForKey(et.trap_GetUserinfo(clientNum), "name"));
	level = et.G_shrubbot_level(clientNum);

	if(AUTO_SHOUTCASTER == 1) then
		if(level >= MIN_SHOUTCASTER_LEVEL) then
			et.trap_SendConsoleCommand(0, "makesc ".. clientNum .."");
		end
	end

	if(AUTO_REFEREE == 1) then
		if(level >= MIN_REFEREE_LEVEL) then
			et.trap_SendConsoleCommand(0, "makeReferee ".. name .."");
		end
	end
end

ENHANCED MOD:

I've never tested enhanced mod with N!tmod because it is in my opinion totally useless to hook a mod that is actively developped. If something's missing simply request the feature instead of making your server unstable with that kind of hooks.

Bot commands work if Omnibot is correctly installed and loaded.
See http://etmods.net/downloads/sampleconfigs/commands.db

I'm no longer used to post long and detailled replies like this, so I hope I didn't forget anything.. ^^


iluvnitmod.png

Offline

#3 30-Oct-12 16:02:28

Megadeth
Member
Registered: 27-Jul-12
Posts: 24

Re: General Question/Support

Oh fair enough, cheers dude smile

Offline

Board footer

Powered by FluxBB