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 20-Dec-20 17:10:07

BarbieKiller
Member
Registered: 23-May-20
Posts: 10

some advice if possible please

on the nitmod is there a script or something to save the private /m messages that get done on the server or a way to see them while playing at all ?

thanks in advance

Offline

#2 21-Dec-20 03:33:58

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

Re: some advice if possible please

Hi,

There's nothing mod-related to save messages but I suppose you can enable logfile on your client and look for private messages afterwards.


iluvnitmod.png

Offline

#3 21-Dec-20 08:29:46

mazak
Member
From: Poland
Registered: 11-Jun-13
Posts: 37

Re: some advice if possible please

Hello!
To view private messages on the server, you need to add a flag pmspec or all.
You have all the flags in this post: Click

Save logfile:

Server:
File type: chatlog.lua

--//Nazwa logu
logname = "chatlog.log"

function et_InitGame( levelTime, randomSeed, restart )
	et.RegisterModname("Chatlog v1.0")
end


function et_ClientCommand( num, cmd )
	if cmd == "say" or cmd == "say_team" or cmd == "say_buddy"
		or cmd == "adminchat" or cmd == "privmsg" or cmd =="m" then
		
		local msg = et.Q_CleanStr(et.ConcatArgs(1))
		
		-- name without colors
		local name = et.Q_CleanStr(et.gentity_get(num, "pers.netname")) 
		
		if cmd == "m" then -- it's a private msg
			-- gets the target name
			local pos = string.find(msg, " ")
			if pos ~= nil then
				local targetname = string.sub(msg, 1, pos-1)
				
				-- if it's a client number, get the real name
				if tonumber(targetname) ~= nil then
					targetname = et.Q_CleanStr(et.gentity_get(tonumber(targetname),
						"pers.netname")) 
				end
				
				msg = "PM->[" .. targetname .. "]" .. string.sub(msg, pos)
			end
		else
			msg = '[' .. cmd .. '] ' .. msg
		end
		
		WriteToFile(logname, string.format("[%s]-[%s]: %s\n",
			os.date("%x %I:%M:%S %p"), name, msg ))
	end
end

function WriteToFile( filename, str )
	fd, len = et.trap_FS_FOpenFile( filename, et.FS_APPEND )
	et.trap_FS_Write( str, string.len(str), fd )
	et.trap_FS_FCloseFile( fd )
end

Client:

seta log	"etconsole"
seta logfile "2"

Last edited by mazak (21-Dec-20 08:45:34)


45868182.jpg
560x95_FFFFFF_FF9900_000000_000000.png

Offline

#4 22-Dec-20 06:36:36

BarbieKiller
Member
Registered: 23-May-20
Posts: 10

Re: some advice if possible please

okay thank you  will give that a shot big_smile

Offline

Board footer

Powered by FluxBB